46def response(resp):
47
48 results = []
49 json_data = loads(resp.text)
50
51 for result in json_data['data']:
52
53 if not result['image_id']:
54 continue
55
56 results.append(
57 {
58 'url': 'https://artic.edu/artworks/%(id)s' % result,
59 'title': result['title'] + " (%(date_display)s) // %(artist_display)s" % result,
60 'content': "%(medium_display)s // %(dimensions)s" % result,
61 'author': ', '.join(result['artist_titles']),
62 'img_src': image_api + '/%(image_id)s/full/843,/0/default.jpg' % result,
63 'template': 'images.html',
64 }
65 )
66
67 return results