aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2020-08-06 15:40:34 -0500
committerepoch <epoch@hacking.allowed.org>2020-08-06 15:40:34 -0500
commit6005986e73e3fd1ef0b761d01ad37891ed4bff6e (patch)
tree4c6570359f742c234fcb60c5cf1048e8ffb3088d
parent41fc135dfa69c1b505a612b1afd71608c082a288 (diff)
downloaduritools-6005986e73e3fd1ef0b761d01ad37891ed4bff6e.tar.gz
uritools-6005986e73e3fd1ef0b761d01ad37891ed4bff6e.zip
now download a lot more bytes to look for <title> because the web is shit
-rwxr-xr-xurititle4
1 files changed, 2 insertions, 2 deletions
diff --git a/urititle b/urititle
index 7e40fd7..a79670a 100755
--- a/urititle
+++ b/urititle
@@ -26,8 +26,8 @@ if [ "$port" ];then
content_type="redirect probably"
fi
if [ "${content_type}" = "text/html" -o "${content_type}" = "application/xhtml+xml" ];then
-# title="$(printf "GET %s HTTP/1.1\r\nHost: %s\r\nUser-Agent: %s\r\n\r\n" "$path" "$domain" "$UA" | ncat -4 $SSL "$domain" "$port" | head -c 10000 | tr -d '\n' | tr '<' '\n' | grep -A 10 '^title>' | grep -B 10 '^\/title>' | cut '-d>' -f2)"
- title="$(curl -si "$1" | head -c 10000 | tr -d '\n' | tr '<' '\n' | grep -iA 10 '^title' | grep -iB 10 '^\/title>' | cut '-d>' -f2 | sed 's/^ .//g' | sed 's/ .$//g' | grep .)"
+# title="$(printf "GET %s HTTP/1.1\r\nHost: %s\r\nUser-Agent: %s\r\n\r\n" "$path" "$domain" "$UA" | ncat -4 $SSL "$domain" "$port" | head -c 10000000 | tr -d '\n' | tr '<' '\n' | grep -A 10 '^title>' | grep -B 10 '^\/title>' | cut '-d>' -f2)"
+ title="$(curl -si "$1" | head -c 1000000 | tr -d '\n' | tr '<' '\n' | grep -iA 10 '^title' | grep -iB 10 '^\/title>' | cut '-d>' -f2 | sed 's/^ .//g' | sed 's/ .$//g' | grep .)"
printf "title: %s\n" "$title" | html_entities_decode
else
printf "%s\n" "${a_header}"