From 3f0c290688a4bdbc9ee4c125f7c5445c5c1ef2e2 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Mon, 10 Aug 2020 18:49:43 -0400 Subject: [PATCH] cut out weird characters from links. --- triggers/link/link.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/triggers/link/link.sh b/triggers/link/link.sh index 04ba9cf..e7b7c35 100755 --- a/triggers/link/link.sh +++ b/triggers/link/link.sh @@ -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!.*]*>\(.*\).*!\1!;T;s!.*\(.*\).*!\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