2016-09-04 17:22:05 -04:00
|
|
|
[ -f functions.sh ] && source functions.sh
|
|
|
|
|
|
|
|
for l in $3 ; do
|
2020-08-10 18:39:43 -04:00
|
|
|
text="${l#:}"
|
|
|
|
if [[ "${text}" =~ http://|https://|www\..* ]]; then
|
2020-11-14 16:46:05 -05:00
|
|
|
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:]' ' ')"
|
2020-08-10 18:49:43 -04:00
|
|
|
pageTitle="$(echo "$pageTitle" | tr -cd '[:print:]')"
|
2020-08-10 09:35:15 -04:00
|
|
|
if [[ ${#pageTitle} -gt 1 ]]; then
|
2020-08-10 18:53:13 -04:00
|
|
|
msg "$2" "$pageTitle"
|
2016-09-04 17:22:05 -04:00
|
|
|
fi
|
2016-09-04 20:51:49 -04:00
|
|
|
fi
|
2016-09-04 17:22:05 -04:00
|
|
|
done
|