Last active
February 10, 2021 22:20
-
-
Save hugosenari/775386e57b9ffb3b37ff3ce1a3e95114 to your computer and use it in GitHub Desktop.
Random Gif URL
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
#!/bin/bash | |
GIF_RATING="${GIF_RATING=pg-13}" | |
GIF_TAG="${GIF_TAG=so-excited}" | |
curl -s 'https://api.giphy.com/v1/gifs/random?api_key='$GIPHY_TOKEN'&tag='$GIF_TAG'&rating='$GIF_RATING | \ | |
sed -E 's/.*image_original_url":"([^"]+)".*/\1\n/gi' | \ | |
tr -d '\\' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use it like this
GIPHY_TOKEN=AAAAAAAAAAAAA \ curl -s https://gist.githubusercontent.com/hugosenari/775386e57b9ffb3b37ff3ce1a3e95114/raw/27baa02a805238c483029d6ade7bad9b723a89b1/random_gif_url.sh|bash -s