-
-
Save armcknight/ee2ec806ae624babd999688e2a75d3ec to your computer and use it in GitHub Desktop.
Retrieve a random quote from bash.org and pipe into macOS' say command. Probs not NSFW.
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
curl -s http://bash.org/?random1 \ | |
| grep -oE "<p class=\"quote\">.*</p>.*</p>" \ | |
| grep -oE "<p class=\"qt.*?</p>" \ | |
| sed -e 's/<\/p>/\n/g' -e 's/<p class=\"qt\">//g' -e 's/<p class=\"qt\">//g' \ | |
| perl -ne 'use HTML::Entities;print decode_entities($_),"\n"' \ | |
| head -1 \ | |
| say |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment