This commit is contained in:
ehpersonal38
2023-02-09 14:09:27 -05:00
committed by GitHub
parent 01b1fe9595
commit c4f85c50de
+1
View File
@@ -68,6 +68,7 @@ def sendAppriseNotifications(species, confidence, path, date, time, week, latitu
# TODO: Make this work with non-english comnames. Implement the "// convert sci name to English name" logic from overview.php here
url = 'https://www.flickr.com/services/rest/?method=flickr.photos.search&api_key='+str(settings_dict.get('FLICKR_API_KEY'))+'&text='+str(comName)+' bird&sort=relevance&per_page=5&media=photos&format=json&license=2%2C3%2C4%2C5%2C6%2C9&nojsoncallback=1'
resp = requests.get(url=url)
resp.encoding= "utf-8"
data = resp.json()["photos"]["photo"][0]
image_url = 'https://farm'+str(data["farm"])+'.static.flickr.com/'+str(data["server"])+'/'+str(data["id"])+'_'+str(data["secret"])+'_n.jpg'