summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtitle.bash4
1 files changed, 3 insertions, 1 deletions
diff --git a/title.bash b/title.bash
index d1754d9..9bed0c5 100755
--- a/title.bash
+++ b/title.bash
@@ -13,6 +13,8 @@
: update user agent string
# v0.8.1: change name in version string to "blatitle"
+OPTS='--location --insecure --silent --max-filesize 1048576 --max-time 10 -A "Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"'
+
read url
if [ "$url" == "-h" ] || [ "$url" == "--help" ]
@@ -22,5 +24,5 @@ elif [ "$url" == "-v" ] || [ "$url" == "--version" ]
then
echo "blatitle version 0.8.1"
else
- curl --location --insecure --silent --max-filesize 1048576 --max-time 10 -A "Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0" "$url" | sed -n -e 'H;${x;s!.*<head[^>]*>\(.*\)</head>.*!\1!I;tnext};b;:next;s!.*<title>\(.*\)</title>.*!\1!pI' | sed ':a;N;$!ba;s/\n//g' | sed -e 's/^[ \t]*//'
+ curl $OPTS "$url" | sed -n -e 'H;${x;s!.*<head[^>]*>\(.*\)</head>.*!\1!I;tnext};b;:next;s!.*<title>\(.*\)</title>.*!\1!pI' | sed ':a;N;$!ba;s/\n//g' | sed -e 's/^[ \t]*//'
fi