X-Git-Url: https://src.twobees.de/?a=blobdiff_plain;ds=sidebyside;f=stow%2Foh-my-zsh%2F.oh-my-zsh%2Fplugins%2Frand-quote%2Frand-quote.plugin.zsh;fp=stow%2Foh-my-zsh%2F.oh-my-zsh%2Fplugins%2Frand-quote%2Frand-quote.plugin.zsh;h=0000000000000000000000000000000000000000;hb=1a8e170bbe5c6641a26ab1ce2e6ce6c5c1faa4cd;hp=23c21dc8f24b887a3dd42493bf572899fba1e7cf;hpb=475ba35502579302593f4735c853c49ef1845dcb;p=dotfiles.git diff --git a/stow/oh-my-zsh/.oh-my-zsh/plugins/rand-quote/rand-quote.plugin.zsh b/stow/oh-my-zsh/.oh-my-zsh/plugins/rand-quote/rand-quote.plugin.zsh deleted file mode 100644 index 23c21dc..0000000 --- a/stow/oh-my-zsh/.oh-my-zsh/plugins/rand-quote/rand-quote.plugin.zsh +++ /dev/null @@ -1,23 +0,0 @@ -if ! (( $+commands[curl] )); then - echo "rand-quote plugin needs curl to work" >&2 - return -fi - -function quote { - setopt localoptions nopromptsubst - - # Get random quote data - local data - data="$(command curl -s --connect-timeout 2 "http://www.quotationspage.com/random.php" \ - | iconv -c -f ISO-8859-1 -t UTF-8 \ - | command grep -a -m 1 'dt class="quote"')" - - # Exit if could not fetch random quote - [[ -n "$data" ]] || return 0 - - local quote author - quote=$(sed -e 's|.*||g' -e 's|.*html||g' -e 's|^[^a-zA-Z]*||' -e 's|||g' <<< "$data") - - print -P "%F{3}${author}%f: “%F{5}${quote}%f”" -}