marvvin

IRC bot
Log | Files | Refs | README | LICENSE

commit a36776662683033b2153ecbcd6e41ef60aafa90d
parent f15b61a9ca50b3fcef99f59663e1e0662cd50bd4
Author: hhvn <hayden@hhvn.uk>
Date:   Mon, 31 May 2021 17:43:29 +0100

filters.sh: add some html escapes

Diffstat:
Mfilters.sh | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/filters.sh b/filters.sh @@ -45,7 +45,11 @@ binsu(){ done } - url_title(){ +html2txt(){ + sed 's~\&amp;~\&~g;s~\&nbsp~ ~g;s~\&reg;~®~g' +} + +url_title(){ export in=$(head -n 1) url=$(echo "$in" | sed 's/invidio.us/www.youtube.com/g;s/m.imdb.com/www.imdb.com/g' | tr -d '\r' | sed 's~embed/~watch?v=~g' | grep -o '[a-z]*://[^ ]*' | sed 's/[\.?>,]$//') set -- $url @@ -86,7 +90,7 @@ binsu(){ echo "$server" | grep -i 'Cloudflare' >/dev/null && repl_notice "Shit: cloudflare." && return echo "$ctype" | grep '[[:alnum:]]' >/dev/null && out="${out}Content-type:$ctype " echo "$server" | grep '[[:alnum:]]' >/dev/null && out="${out}Server:$server " - echo "$out" | grep '[[:alnum:]]' >/dev/null && repl_notice "$(echo "$out" | cut -zc-200)" + echo "$out" | grep '[[:alnum:]]' >/dev/null && repl_notice "$(echo "$out" | html2txt | cut -zc-200)" return } content=$($tor curl -L "$1" | tr -d '\r') @@ -106,7 +110,7 @@ binsu(){ echo "$description" | grep '[[:alnum:]]' >/dev/null && out="${out}Description: $description... " echo "$ctype" | grep '[[:alnum:]]' >/dev/null && out="${out}Content-type:$ctype " echo "$server" | grep '[[:alnum:]]' >/dev/null && out="${out}Server:$server " - echo "$out" | grep '[[:alnum:]]' >/dev/null && repl_notice "$(echo "$out" | cut -zc-200)" + echo "$out" | grep '[[:alnum:]]' >/dev/null && repl_notice "$(echo "$out" | html2txt | cut -zc-200)" } puma(){