diff options
author | San Martin Morote Eduardo <posva13@gmail.com> | 2013-06-09 11:01:20 +0200 |
---|---|---|
committer | San Martin Morote Eduardo <posva13@gmail.com> | 2013-06-09 11:01:20 +0200 |
commit | e4884da5a09b121a43121c79449e4cfae7a5c9d0 (patch) | |
tree | 713652d86ffa4eea42cb926167254eaa12c5b9b0 /plugins | |
parent | 27c6becffde091cc55e0df70875451ca82867935 (diff) | |
download | zsh-e4884da5a09b121a43121c79449e4cfae7a5c9d0.tar.gz zsh-e4884da5a09b121a43121c79449e4cfae7a5c9d0.tar.bz2 zsh-e4884da5a09b121a43121c79449e4cfae7a5c9d0.zip |
Random quotes from the internet
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/rand-quote/rand-quote.plugin.zsh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/rand-quote/rand-quote.plugin.zsh b/plugins/rand-quote/rand-quote.plugin.zsh new file mode 100644 index 000000000..b85abc81c --- /dev/null +++ b/plugins/rand-quote/rand-quote.plugin.zsh @@ -0,0 +1,17 @@ +Get a random quote fron the sitehttp://www.quotationspage.com/random.php3 +# Created by Eduardo San Martin Morote aka Posva +# http://posva.github.io +# Sun Jun 09 10:59:36 CEST 2013 +# Don't remove this header, thank you +# Usage: quote + +if [[ -x `which curl` ]]; then + function quote() + { + Q=$(curl -s --connect-timeout 2 "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}\e[0;30m: \e[0;35m“${TXT}”\e[m" + } + #quote +fi |