cut out weird characters from links.

This commit is contained in:
Storm Dragon 2020-08-10 18:49:43 -04:00
parent 521b862c1c
commit 3f0c290688

View File

@ -4,8 +4,9 @@ for l in $3 ; do
text="${l#:}"
if [[ "${text}" =~ http://|https://|www\..* ]]; then
pageTitle="$(curl -L -s --connect-timeout 5 "$text" | sed -n -e 'H;${x;s!.*<head[^>]*>\(.*\)</head>.*!\1!;T;s!.*<title>\(.*\)</title>.*!\1!p}' | pandoc -t plain | tr '[:space:]' ' ')"
pageTitle="$(echo "$pageTitle" | tr -cd '[:print:]')"
if [[ ${#pageTitle} -gt 1 ]]; then
msg "$2" "$pageTitle"
echo "$2" "$pageTitle"
fi
fi
done