Removed the pandoc dependency from the link trigger.

This commit is contained in:
Kyle 2020-11-14 21:46:05 +00:00
parent 0f04da04ea
commit 2f13552fb2

View File

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