[ -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:]' ' ')" if [[ ${#pageTitle} -gt 1 ]]; then msg "$2" "$pageTitle" fi fi done