From d573108c4c13ed4025473bcd2693b0e665fb5cbb Mon Sep 17 00:00:00 2001 From: epochqwert Date: Fri, 1 Dec 2017 09:24:41 +0000 Subject: copied over the updated title.sh --- nocompile/bin/title.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 nocompile/bin/title.sh diff --git a/nocompile/bin/title.sh b/nocompile/bin/title.sh new file mode 100755 index 0000000..32b0deb --- /dev/null +++ b/nocompile/bin/title.sh @@ -0,0 +1,11 @@ +#!/bin/sh +export PATH=/usr/local/bin:/usr/pkg/bin:/usr/bin:/bin +printf '%s\n' "$1" | grep -Fvf /var/log/toirc/links >> /var/log/toirc/links +#wget -4 --user-agent="" -qO- "$1" +type="$(/usr/pkg/bin/curl -sA "" -I -4 "$1" | grep -i "Content-Type" | cut '-d ' -f2)" +if printf "%stext/html\n" "$type" | grep "^text/html" >/dev/null 2>&1 ;then + echo -n "title: " + /usr/pkg/bin/curl -sA "" -4 "$1" | tr '>' '\n' | XuntilY "<[Tt][Ii][Tt][Ll][Ee]" "