Skip to content
Permalink
Browse files

fix for failed favicon discovery

  • Loading branch information...
shawnmjones committed Jul 11, 2019
1 parent 2113eb9 commit 47b2954ef3720cdf7074bc1f98c9e05fa287ba30
@@ -129,7 +129,9 @@ With a fully operational MementoEmbed, integration tests are possible.
python -m unittest discover -s tests/integration
```

Note that integration tests are heavily dependent on environmental factors such as the current state of web archive playback systems. The favicon detection appears to be especially unpredictable. Because of this, we recommend that integration tests be reviewed by humans and not executed automatically on build.
Integration tests, by default, assume that the instance to be tested is running at port 5550. This can be altered with the `TESTPORT` environment variable, like so: `export TESTPORT=9000`.

Integration tests are heavily dependent on environmental factors such as the current state of web archive playback systems. The favicon detection appears to be especially unpredictable. Because of this, we recommend that integration tests be reviewed by humans and not executed automatically on build.

# Contributing

@@ -26,7 +26,7 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '0.2019.07.11.030842'
release = '0.2019.07.11.152847'


# -- General configuration ---------------------------------------------------
@@ -9,7 +9,8 @@
find_conventional_favicon_on_live_web, query_timegate_for_favicon, \
get_favicon_from_resource_content, construct_conventional_favicon_uri

from .mementoresource import get_memento_datetime_from_response, NotAMementoError
from .mementoresource import get_memento_datetime_from_response, NotAMementoError, \
MementoURINotAtArchiveFailure

module_logger = logging.getLogger('mementoembed.originalresource')

@@ -64,7 +65,7 @@ def favicon(self):
# if we get here, then it is a memento, just use it
self.original_link_favicon_uri = candidate_favicon

except NotAMementoError:
except (NotAMementoError, MementoURINotAtArchiveFailure):
# try datetime negotiation
self.original_link_favicon_uri = query_timegate_for_favicon(
self.memento.timegate[0:self.memento.timegate.find(self.uri)],
@@ -54,6 +54,7 @@ def handle_errors(function_name, urim, preferences):
"content": e.user_facing_error,
"response headers": dict(e.response.headers),
"response status": e.response.status_code,
"uri submitted": e.response.url,
"error details": repr(traceback.format_exc())
}, indent=4))
response.headers['Content-Type'] = 'application/json'
@@ -1,3 +1,3 @@
__appname__ = "MementoEmbed"
__appversion__ = '0.2019.07.11.030842'
__appversion__ = '0.2019.07.11.152847'
__useragent__ = "{}/{}".format(__appname__, __appversion__)
@@ -11,4 +11,5 @@ http://webarchive.loc.gov/all/20160830014245/https://www.whitehouse.gov/,The Whi
http://archive.is/MIq1y,Virginia Commonwealth University - School of Engineering,"CS Seminar – Michael L. Nelson, Ph.D. February 24, 201711:00 a.m. – 12:00 p.m. Engineering West Hall, Room 106 The Department of Computer Science is pleased to present Dr. Michael L. Nelson, Profes",2017-02-14T22:18:32Z,https://archive.is/MIq1y/6287ab3e834f85e94198b71febff904c6be45ad3.png,http://archive.is,ARCHIVE.IS,http://archive.is/favicon.ico,,,,http://www.egr.vcu.edu/news-events/events/cs-seminar-michael-l-nelson-phd.html,www.egr.vcu.edu,https://www.google.com/s2/favicons?domain=vcu.edu,Rotten
http://wayback.archive-it.org/all/20160209000335/https://twitter.com/TEN_GOP/status/689216708695994368,Tennessee GOP on Twitter,"“If #MLK was alive today, he'd lead ""All Lives Matter"" March in Washington DC #MLKDay #MLKDay2016 #AllLivesMatter”",2016-02-09T00:03:35Z,http://wayback.archive-it.org/all/20160209000335im_/https://pbs.twimg.com/profile_banners/4224729994/1449504876/1500x500,https://archive-it.org,ARCHIVE-IT.ORG,https://www.archive-it.org/favicon.ico,,,,https://twitter.com/TEN_GOP/status/689216708695994368,twitter.com,http://wayback.archive-it.org/all/20160209000335im_/https://abs.twimg.com/favicons/favicon.ico,Live
https://webrecorder.io/shawnmjones/storify-stories/list/bookmarks/b1/20171214011344/https://storify.com/ait_stories/2823spst0s,Russia Plane Crash,A Social Media Story storified by ait_stories,2017-12-14T01:13:44Z,https://content.webrecorder.io/shawnmjones/storify-stories/list/bookmarks/b1/20171214011344im_/https://storify.com/services/proxy/2/80_6oMeAvZw7FepY3ymYmA/http/www.theprovince.com/5364368.bin,https://webrecorder.io,WEBRECORDER.IO,https://webrecorder.io/static/favicon.png?v=3,storify-stories,Storify Stories,https://webrecorder.io/shawnmjones/storify-stories,https://storify.com/ait_stories/2823spst0s,storify.com,https://www.google.com/s2/favicons?domain=storify.com,Rotten
https://webrecorder.io/despens/bear-with-me/list/bookmarks/b1/20170318154741/http://bearwithme.theater/archive/,Bear With Me Archive,"Also FYI tonight's https://t.co/lVn1WKqP99 SOLD OUT! But, waiting list starts at 7, and good chance a few seats will open up! (6/6) pic.twitter.com/rJWbm9bXeV— Cory Arcangel (@cory_arcangel) Februa",2017-03-18T15:47:41Z,https://content.webrecorder.io/despens/bear-with-me/list/bookmarks/b1/20170318154741mp_/http:/bearwithme.theater/archive/berlin/kev_ol_reh_ber.jpg,https://webrecorder.io/,WEBRECORDER.IO,https://webrecorder.io/static/favicon.png?v=3,bear-with-me,Bear With Me,https://webrecorder.io/despens/bear-with-me,http://bearwithme.theater/archive/,bearwithme.theater,https://www.google.com/s2/favicons?domain=bearwithme.theater,Live
https://webrecorder.io/despens/bear-with-me/list/bookmarks/b1/20170318154741/http://bearwithme.theater/archive/,Bear With Me Archive,"Also FYI tonight's https://t.co/lVn1WKqP99 SOLD OUT! But, waiting list starts at 7, and good chance a few seats will open up! (6/6) pic.twitter.com/rJWbm9bXeV— Cory Arcangel (@cory_arcangel) Februa",2017-03-18T15:47:41Z,https://content.webrecorder.io/despens/bear-with-me/list/bookmarks/b1/20170318154741mp_/http:/bearwithme.theater/archive/berlin/kev_ol_reh_ber.jpg,https://webrecorder.io,WEBRECORDER.IO,https://webrecorder.io/static/favicon.png?v=3,bear-with-me,Bear With Me,https://webrecorder.io/despens/bear-with-me,http://bearwithme.theater/archive/,bearwithme.theater,https://www.google.com/s2/favicons?domain=bearwithme.theater,Live
https://webrecorder.io/despens/blackberry-is-gonna-keep-on-loving-you/list/bookmarks/b2/20170618161948/https://twitter.com/BBMobile/status/876471347664355328,BlackBerry Mobile on Twitter,“Happy #FathersDay to all the #BlackBerry Dads out there using the #KEYone smartphone to connect with their loved ones! https://t.co/6k56F5VecQ”,2017-06-18T16:19:48Z,https://content.webrecorder.io/despens/blackberry-is-gonna-keep-on-loving-you/list/bookmarks/b2/20170618161948im_/https://pbs.twimg.com/media/DCnbRhwXsAAupFE.jpg,https://webrecorder.io,WEBRECORDER.IO,https://webrecorder.io/static/favicon.png?v=3,blackberry-is-gonna-keep-on-loving-you,BlackBerry is gonna keep on loving you,https://webrecorder.io/despens/blackberry-is-gonna-keep-on-loving-you,https://twitter.com/BBMobile/status/876471347664355328,twitter.com,https://twitter.com/favicon.ico,Live

0 comments on commit 47b2954

Please sign in to comment.
You can’t perform that action at this time.