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 ...@@ -17,7 +17,7 @@ SRCT Bookshare • Charts
<div class="page-header" id="banner"> <div class="page-header" id="banner">
<div class="row"> <div class="row">
<div class="col-lg-12 text-center"> <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> <p class="lead"><strong>Listing Charts</strong></p>
</div> </div>
</div> </div>
......
...@@ -31,7 +31,13 @@ def ISBNMetadata(standardISBN): ...@@ -31,7 +31,13 @@ def ISBNMetadata(standardISBN):
url = "http://xisbn.worldcat.org/webservices/xid/isbn/" +\ url = "http://xisbn.worldcat.org/webservices/xid/isbn/" +\
str(standardISBN) +\ str(standardISBN) +\
"?method=getMetadata&format=json&fl=title,year,author,ed" "?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 # format into a dictionary
dejson = metadata.json() dejson = metadata.json()
try: 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