summaryrefslogtreecommitdiff
path: root/title.bash
diff options
context:
space:
mode:
Diffstat (limited to 'title.bash')
-rwxr-xr-xtitle.bash2
1 files changed, 1 insertions, 1 deletions
diff --git a/title.bash b/title.bash
index 988f544..fcb8a83 100755
--- a/title.bash
+++ b/title.bash
@@ -74,7 +74,7 @@ else
then
grep -m1 . /tmp/$TIME.body
else
- cat /tmp/$TIME.body | tr '\n' ' ' | tr '\r' ' ' | grep -oiE '<title.*>.*</title>' | sed -r 's/<title[^>]*//I; s/^>//I; s/<\/title>$//I' | php -r 'while(($line=fgets(STDIN)) !== FALSE) echo html_entity_decode($line, ENT_QUOTES|ENT_HTML401);'
+ cat /tmp/$TIME.body | tr '\n' ' ' | tr '\r' ' ' | grep -oiE '<title[^>]*>([^<]+)<\/title>' | head -1 | sed -r 's/<title[^>]*//I; s/^>//I; s/<\/title>$//I' | php -r 'while(($line=fgets(STDIN)) !== FALSE) echo html_entity_decode($line, ENT_QUOTES|ENT_HTML401);'
fi
rm /tmp/$TIME.header /tmp/$TIME.body
fi