move fetching artwork list into art func for now

This commit is contained in:
zuckerberg 2021-08-22 22:29:00 -04:00
parent 65c8994600
commit b2c8335bad

8
art.py
View File

@ -4,11 +4,11 @@ import re
host = "https://collectionapi.metmuseum.org/public/collection/v1/" host = "https://collectionapi.metmuseum.org/public/collection/v1/"
# get the list of artwork
r = requests.get(host + 'objects')
objects = r.json()['objectIDs']
def getArt(term): def getArt(term):
# get the list of artwork
r = requests.get(host + 'objects')
objects = r.json()['objectIDs']
searchObjects = objects searchObjects = objects
if term: if term:
query = {'q': term, 'hasImages': 'true'} query = {'q': term, 'hasImages': 'true'}