44 for item
in resp.json().get(
"docs", []):
46 if 'lending_identifier_s' in item:
47 cover = f
"https://archive.org/services/img/{item['lending_identifier_s']}"
49 published = item.get(
'publish_date')
51 published_dates = [date
for date
in map(_parse_date, published)
if date]
53 published = min(published_dates)
56 published = parser.parse(str(item.get(
'first_published_year')))
59 'template':
'paper.html',
60 'url': f
"{base_url}{item['key']}",
61 'title': item[
'title'],
62 'content': re.sub(
r"\{|\}",
"", item[
'first_sentence'][0])
if item.get(
'first_sentence')
else '',
63 'isbn': item.get(
'isbn', [])[:5],
64 'authors': item.get(
'author_name', []),
66 'publishedDate': published,
67 'tags': item.get(
'subject', [])[:10] + item.get(
'place', [])[:10],
69 results.append(result)