Skip to content
Permalink
Browse files

working seeddata endpoint

  • Loading branch information...
shawnmjones committed May 4, 2019
1 parent 4fc1bb9 commit 3f1e0e1fd34dc7650cedb979609965256705f20d
Showing with 25 additions and 26 deletions.
  1. +2 −1 mementoembed/seedresource.py
  2. +6 −7 mementoembed/services/memento.py
  3. +17 −18 setup.py
@@ -86,7 +86,7 @@ def __init__(self, memento, httpcache):
else:
self.aic = None

response = get_memento(httpcache.get, memento.urim)
response = get_memento(self.httpcache, memento.urim)
self.urit = get_timemap_from_response(response)
self.urir = get_original_uri_from_response(response)

@@ -148,6 +148,7 @@ def seed_metadata(self):

if self.aic is not None:

self.aic.load_seed_metadata() # workaround for aiu bug
metadata = self.aic.get_seed_metadata(self.urir)['collection_web_pages']

return metadata
@@ -189,10 +189,10 @@ def seeddata(urim, preferences):

output['urim'] = urim
output['seeduri'] = sr.urir
output['mementocount'] = sr.mementocount
output['first-mdt'] = sr.first_mdt
output['last-mdt'] = sr.last_mdt
output['metadata'] = sr.seed_metadata
output['mementocount'] = sr.mementocount()
output['first-mdt'] = sr.first_mdt().strftime("%Y-%m-%dT%H:%M:%SZ")
output['last-mdt'] = sr.last_mdt().strftime("%Y-%m-%dT%H:%M:%SZ")
output['metadata'] = sr.seed_metadata()

response = make_response(json.dumps(output, indent=4))
response.headers['Content-Type'] = 'application/json'
@@ -276,9 +276,8 @@ def originaldata_endpoint(subpath):
return handle_errors(originaldata, urim, prefs)

@bp.route('/services/memento/seeddata/<path:subpath>')
def aitdata_endpoint(subpath):
urim = extract_urim_from_request_path(request.full_path, '/services/memento/aitdata/')

def seeddata_endpoint(subpath):
urim = extract_urim_from_request_path(request.full_path, '/services/memento/seeddata/')
prefs = {}

return handle_errors(seeddata, urim, prefs)
@@ -13,24 +13,23 @@
packages=find_packages(),
include_package_data=True,
install_requires=[
'aiu',
'Brotli',
'bs4',
'cairosvg',
'dicttoxml',
'flask',
'html5lib',
'htmlmin',
'justext',
'Pillow',
'pycairo',
'python-magic',
'readability-lxml',
'redis',
'requests',
'requests_cache',
'sphinx',
'tldextract'
'aiu==0.1.0a1',
'Brotli==1.0.4',
'bs4==0.0.1',
'cairosvg==2.3.0',
'dicttoxml==1.7.4',
'flask==1.0.2',
'html5lib==1.0.1',
'htmlmin==0.1.12',
'justext==2.2.0',
'Pillow==5.2.0',
'python-magic==0.4.15',
'readability-lxml==0.7',
'redis==2.10.6',
'requests>=2.20.0',
'requests_cache==0.4.13',
'sphinx==1.8.4',
'tldextract==2.2.0'
],
scripts=['bin/fetch_surrogate_data'],
test_suite="tests"

0 comments on commit 3f1e0e1

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