Created
November 1, 2017 23:38
-
-
Save teenoh/5af9bc7c630ccb4088c2baae22e5e66e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def search_gif(text): | |
#get a GIF that is similar to text sent | |
payload = {'s': text, 'api_key': '<GIPHY_API_KEY>'} | |
r = requests.get('http://api.giphy.com/v1/gifs/translate', params=payload) | |
r = r.json() | |
url = r['data']['images']['original']['url'] | |
return url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment