Switched from tr -cd print to iconv to prevent crash characters.
This commit is contained in:
parent
e1bb820a41
commit
d5ee33b24b
@ -8,5 +8,5 @@ quote="${quote//</ <}"
|
||||
quote="${quote//>/> }"
|
||||
quote="${quote%%<p class*}"
|
||||
quote="$(echo "$quote" | w3m -dump -T text/html)"
|
||||
msg "$2" "$(echo "$quote" | tr -cd '[:print:]')"
|
||||
msg "$2" "$(echo "$quote" | iconv -f utf-8 -t ascii)"
|
||||
set +f
|
||||
|
@ -1,6 +1,6 @@
|
||||
[ -f functions.sh ] && source functions.sh
|
||||
|
||||
fml="$(curl -Ls --connect-timeout 5 https://fmylife.com/random | grep -m1 -A1 '<a class="article-link" href="/article/.*>' | tail -1 | w3m -dump -T text/html | tr '[:space:]' ' ' | tr -cd '[:print:]')"
|
||||
fml="$(curl -Ls --connect-timeout 5 https://fmylife.com/random | grep -m1 -A1 '<a class="article-link" href="/article/.*>' | tail -1 | w3m -dump -T text/html | tr '[:space:]' ' ' | iconv -f utf-8 -t ascii)"
|
||||
|
||||
if [[ ${#fml} -gt 10 ]]; then
|
||||
msg "$2" "${fml}"
|
||||
|
Loading…
Reference in New Issue
Block a user