Try to stop weird symbols from quotes crashing the bot.
This commit is contained in:
parent
a917ff513d
commit
9d503d2196
@ -1,5 +1,6 @@
|
|||||||
[ -f functions.sh ] && source functions.sh
|
[ -f functions.sh ] && source functions.sh
|
||||||
|
|
||||||
|
set -f
|
||||||
quote="$(curl -s http://bash.org/?random)"
|
quote="$(curl -s http://bash.org/?random)"
|
||||||
quote="$(echo "$quote" | grep -m 1 -A 10 '"Permanent link to this quote."')"
|
quote="$(echo "$quote" | grep -m 1 -A 10 '"Permanent link to this quote."')"
|
||||||
quote="${quote#*class=\"qt\">}"
|
quote="${quote#*class=\"qt\">}"
|
||||||
@ -7,5 +8,5 @@ quote="${quote//</<}"
|
|||||||
quote="${quote//>/>}"
|
quote="${quote//>/>}"
|
||||||
quote="${quote%%<p class*}"
|
quote="${quote%%<p class*}"
|
||||||
quote="$(echo "$quote" | pandoc -t plain)"
|
quote="$(echo "$quote" | pandoc -t plain)"
|
||||||
msg "$2" "$(echo "$quote" | tr -s '[:space:]' ' ')"
|
msg "$2" "$(echo "$quote" | tr -cd '[:print:]')"
|
||||||
exit 0
|
set +f
|
||||||
|
Loading…
x
Reference in New Issue
Block a user