Created
June 8, 2021 22:16
-
-
Save jexp/2c85421842220521b361fd6f2ecb7799 to your computer and use it in GitHub Desktop.
Random Giphy images in Jupyter notebook to keep your audience entertained while they wait for data processing
This file contains 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
!pip install giphy_client | |
import giphy_client | |
import random | |
from IPython.core.display import display, HTML | |
api_instance = giphy_client.DefaultApi() | |
api_key = '***' # from https://developers.giphy.com/dashboard/ | |
search = 'science' | |
api_response = api_instance.gifs_search_get( api_key, search, limit=25) | |
images = [img.images.fixed_height.url for img in api_response.data] | |
# cell 2 | |
display(HTML("<img src='%s' height='200'/>" % random.choice(images))) |
Author
jexp
commented
Jun 8, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment