e4884da5a09b121a43121c79449e4cfae7a5c9d0

Author
San Martin Morote Eduardo <posva13@gmail.com>
Committer
San Martin Morote Eduardo <posva13@gmail.com>
Date

Message

Random quotes from the internet

Diff

 1diff --git a/plugins/rand-quote/rand-quote.plugin.zsh b/plugins/rand-quote/rand-quote.plugin.zsh
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..b85abc81cd8364710ecf09f5bc432c986fbe25f1
 4--- /dev/null
 5+++ b/plugins/rand-quote/rand-quote.plugin.zsh
 6@@ -0,0 +1,17 @@
 7+Get a random quote fron the sitehttp://www.quotationspage.com/random.php3
 8+# Created by Eduardo San Martin Morote aka Posva
 9+# http://posva.github.io
10+# Sun Jun 09 10:59:36 CEST 2013 
11+# Don't remove this header, thank you
12+# Usage: quote
13+
14+if [[ -x `which curl` ]]; then
15+    function quote()
16+    {
17+        Q=$(curl -s --connect-timeout 2 "http://www.quotationspage.com/random.php3" | grep -m 1 "dt ")
18+        TXT=$(echo "$Q" | sed -e 's/<\/dt>.*//g' -e 's/.*html//g' -e 's/^[^a-zA-Z]*//' -e 's/<\/a..*$//g')
19+        W=$(echo "$Q" | sed -e 's/.*\/quotes\///g' -e 's/<.*//g' -e 's/.*">//g')
20+        echo "\e[0;33m${W}\e[0;30m: \e[0;35m“${TXT}”\e[m"
21+    }
22+    #quote
23+fi