diff options
author | epoch <epoch@hacking.allowed.org> | 2020-08-06 15:40:34 -0500 |
---|---|---|
committer | epoch <epoch@hacking.allowed.org> | 2020-08-06 15:40:34 -0500 |
commit | 6005986e73e3fd1ef0b761d01ad37891ed4bff6e (patch) | |
tree | 4c6570359f742c234fcb60c5cf1048e8ffb3088d /urititle | |
parent | 41fc135dfa69c1b505a612b1afd71608c082a288 (diff) | |
download | uritools-6005986e73e3fd1ef0b761d01ad37891ed4bff6e.tar.gz uritools-6005986e73e3fd1ef0b761d01ad37891ed4bff6e.zip |
now download a lot more bytes to look for <title> because the web is shit
Diffstat (limited to 'urititle')
-rwxr-xr-x | urititle | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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}" |