Created
May 17, 2013 19:45
-
-
Save posva/5601518 to your computer and use it in GitHub Desktop.
Color formatted code for zsh (may work in other terminals) to display a random quote from http://www.quotationspage.com/random.php3
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/zsh | |
Q=$(curl -s "http://www.quotationspage.com/random.php3" | grep -m 1 "dt ") | |
TXT=$(echo "$Q" | sed -e 's/<\/dt>.*//g' -e 's/.*html//g' -e 's/^[^a-zA-Z]*//' -e 's/<\/a..*$//g') | |
W=$(echo "$Q" | sed -e 's/.*\/quotes\///g' -e 's/<.*//g' -e 's/.*">//g') | |
echo "\e[0;33m${W}\033[0\e[0;30m: \e[0;35m“${TXT}”\e[m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment