From 521b862c1cf9abe9e7880b2742bf57f0528ac530 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Mon, 10 Aug 2020 18:39:43 -0400 Subject: [PATCH] Links reported more accurately. --- triggers/link/link.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/triggers/link/link.sh b/triggers/link/link.sh index c7bbea9..04ba9cf 100755 --- a/triggers/link/link.sh +++ b/triggers/link/link.sh @@ -1,8 +1,9 @@ [ -f functions.sh ] && source functions.sh for l in $3 ; do -if [[ "${l}" =~ http://|https://|www\..* ]]; then -pageTitle="$(curl -L -s --connect-timeout 5 "$l" | sed -n -e 'H;${x;s!.*]*>\(.*\).*!\1!;T;s!.*\(.*\).*!\1!p}' | pandoc -t plain | tr '[:space:]' ' ')" +text="${l#:}" +if [[ "${text}" =~ http://|https://|www\..* ]]; then +pageTitle="$(curl -L -s --connect-timeout 5 "$text" | sed -n -e 'H;${x;s!.*]*>\(.*\).*!\1!;T;s!.*\(.*\).*!\1!p}' | pandoc -t plain | tr '[:space:]' ' ')" if [[ ${#pageTitle} -gt 1 ]]; then msg "$2" "$pageTitle" fi