Commit 773c6517 authored by Daniel W Bond's avatar Daniel W Bond

Merge branch 'jrouly/bookshare-master'

parents b92a75e6 c283d6ce
......@@ -17,7 +17,7 @@ SRCT Bookshare • Charts
<div class="page-header" id="banner">
<div class="row">
<div class="col-lg-12 text-center">
<h1><strong>SRCT</strong>BOOKSHARE</h1>
<h1><strong>SRCT</strong>&#8203;BOOKSHARE</h1>
<p class="lead"><strong>Listing Charts</strong></p>
</div>
</div>
......
......@@ -31,7 +31,13 @@ def ISBNMetadata(standardISBN):
url = "http://xisbn.worldcat.org/webservices/xid/isbn/" +\
str(standardISBN) +\
"?method=getMetadata&format=json&fl=title,year,author,ed"
metadata = requests.get(url)
# In case the API fails to return, simply return None.
try:
metadata = requests.get(url, timeout=3)
except ConnectionError:
return None
# format into a dictionary
dejson = metadata.json()
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment