Permalink
Browse files

more work for #126, endpoints for the UI are fixed now

  • Loading branch information...
shawnmjones committed Sep 5, 2018
1 parent 5d7b380 commit f7f11e37bdcf2dd71ae9fa14f53c64ed64071e8f
@@ -163,13 +163,20 @@ def no_urim():
@bp.route('/services/memento/contentdata/<path:subpath>')
def textinformation_endpoint(subpath):
urim = subpath
module_logger.debug("full path: {}".format(request.full_path))
# because Flask trims off query strings
urim = request.full_path[len('/services/memento/contentdata/'):]
preferences = {}
module_logger.debug("URI-M for content data is {}".format(urim))
return handle_errors(contentdata, urim, preferences)
@bp.route('/services/memento/bestimage/<path:subpath>')
def bestimage_endpoint(subpath):
urim = subpath
# because Flask trims off query strings
urim = request.full_path[len('/services/memento/bestimage/'):]
prefs = {}
prefs['datauri_image'] = 'no'
@@ -185,7 +192,8 @@ def bestimage_endpoint(subpath):
@bp.route('/services/memento/archivedata/<path:subpath>')
def archivedata_endpoint(subpath):
urim = subpath
# because Flask trims off query strings
urim = request.full_path[len('/services/memento/archivedata/'):]
prefs = {}
prefs['datauri_favicon'] = 'no'
@@ -201,7 +209,8 @@ def archivedata_endpoint(subpath):
@bp.route('/services/memento/originalresourcedata/<path:subpath>')
def originaldata_endpoint(subpath):
urim = subpath
# because Flask trims off query strings
urim = request.full_path[len('/services/memento/originalresourcedata/'):]
prefs = {}
prefs['datauri_favicon'] = 'no'
@@ -44,7 +44,7 @@ <h1 class="mt-5" id="workstatus">Create a {{ surrogate_type }}</h1>
archivedata = null;
originaldata = null;
urim = "{{ urim }}";
urim = "{{ urim|safe }}";
console.log("urim: " + urim);
workstatus.innerHTML = "";
@@ -36,7 +36,7 @@ <h1 class="mt-5" id="workstatus">Create a {{ surrogate_type }}</h1>
workstatus = document.getElementById("workstatus");
progress = document.getElementById("progressarea");
urim = "{{ urim }}";
urim = "{{ urim|safe }}";
console.log("urim: " + urim);
workstatus.innerHTML = "";
View
@@ -41,11 +41,12 @@ def generate_social_card(subpath):
server_domain = "{{ server_domain }}"
)
urim = subpath
# because Flask trims off query strings
urim = request.full_path[len('/ui/product/socialcard/'):]
if subpath[0:4] != "http":
if urim[0:4] != "http":
pathprefs, urim = subpath.split('/', 1)
pathprefs, urim = urim.split('/', 1)
module_logger.debug("prefs: {}".format(pathprefs))
module_logger.debug("urim: {}".format(urim))
@@ -95,9 +96,12 @@ def generate_thumbnail(subpath):
module_logger.debug("received path {}".format(subpath))
if subpath[0:4] != "http":
# because Flask trims off query strings
urim = request.full_path[len('/ui/product/thumbnail/'):]
pathprefs, urim = subpath.split('/', 1)
if urim[0:4] != "http":
pathprefs, urim = urim.split('/', 1)
module_logger.debug("prefs: {}".format(pathprefs))
module_logger.debug("urim: {}".format(urim))
@@ -115,9 +119,6 @@ def generate_thumbnail(subpath):
else:
module_logger.exception("failed to set value for preference {}".format(key))
else:
urim = subpath
return render_template('generate_thumbnail.html',
urim = urim,
pagetitle="MementoEmbed - Generate a Thumbnail",
View
@@ -37,4 +37,5 @@ http://wayback.archive-it.org/all/20160209000335/https://twitter.com/TEN_GOP/sta
https://web.archive.org/web/20180320171651/https://dribbble.com/
http://mementoarchive.lanl.gov/twa/memento/20180705155231/http://lanlsource.lanl.gov/hello
https://collections.internetmemory.org/proni/content/20170101080206/https://afbini.gov.uk/
http://wayback.archive-it.org/2823/20110911114626/http://www.nzherald.co.nz/world/news/article.cfm?c_id=2&objectid=10750223
http://wayback.archive-it.org/2017/20101026004107/http://www.defense.gov/news/newsarticle.aspx?id=61411

0 comments on commit f7f11e3

Please sign in to comment.