2016-09-04 17:22:05 -04:00
|
|
|
[ -f functions.sh ] && source functions.sh
|
|
|
|
|
2017-05-20 08:33:05 -04:00
|
|
|
curl="$(command -v curl) --connect-timeout 5"
|
2016-09-04 17:22:05 -04:00
|
|
|
for l in $3 ; do
|
2016-09-08 12:16:59 -04:00
|
|
|
if [[ "${l#:}" =~ http://|https://|www\.*\.* ]]; then
|
2017-09-11 09:12:15 -04:00
|
|
|
pageTitle="$($curl -Ls "${l#:}" | sed -n 's/<title>\(.*\)<\/title>/\1/p' | head -1 | html2text | tr -s '[:space:]' ' ')"
|
2016-09-04 17:22:05 -04:00
|
|
|
shortLink="${l#*://}"
|
|
|
|
shortLink="${shortLink%%/*}"
|
2016-09-08 12:16:59 -04:00
|
|
|
if [ ${#pageTitle} -gt 1 ]; then
|
2016-09-04 17:22:05 -04:00
|
|
|
msg "$2" "$pageTitle at $shortLink"
|
|
|
|
fi
|
2016-09-04 20:51:49 -04:00
|
|
|
fi
|
2016-09-04 17:22:05 -04:00
|
|
|
done
|