Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Piping in your shell using jq and curl
Some terminal geeks would like to spice up their MOTD or sshd banner with a scooter quote.
All deps for below commands:
brew install curl jq youtube-dl mplayer
For this example you must install jq and curl if not present. Both should be in your favorite package manager.
Random quote:
curl -s | jq -r '.quote.text'
Daily quote:
curl -s | jq -r '.quote.text'
Or spice things op with cowsay:
curl -s | jq -r '.quote.text' | cowsay
Or if you want to get all funky, throw it in aalib/aview:
curl -s `curl -s | jq -r '.quote.album_cover'` | convert fd:0 pnm:- | aview
Install youtube-dl and mplayer and have some fun with this command:
youtube-dl -q -o- $(curl -s '' | jq -r '.quote.videos[0].link') | mplayer -cache 8192 -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment