stormbot/modules/bash/bash.sh

13 lines
394 B
Bash
Executable File

[ -f functions.sh ] && source functions.sh
set -f
quote="$(curl -s http://bash.org/?random)"
quote="$(echo "$quote" | grep -m 1 -A 10 '"Permanent link to this quote."')"
quote="${quote#*class=\"qt\">}"
quote="${quote//&lt;/ <}"
quote="${quote//&gt;/> }"
quote="${quote%%<p class*}"
quote="$(echo "$quote" | w3m -dump -T text/html)"
msg "$2" "$(echo "$quote" | iconv -f utf-8 -t ascii)"
set +f