def giphy(subject, api_key):
- url = 'http://api.giphy.com/v1/gifs/random?tag={}&api_key={}&limit=1&offset=0'.format(subject, api_key)
+ url = 'https://api.giphy.com/v1/gifs/random?tag={}&api_key={}&limit=1&offset=0'.format(subject, api_key)
response = requests.get(url)
giphy_url = None
try:
data = response.json()
- giphy_url = data['data']['image_url']
+ giphy_url = data['data']['images']['original']['url']
except:
pass
return giphy_url