diff options
author | Fbenas <philbeansburton@gmail.com> | 2019-06-04 18:01:33 +0100 |
---|---|---|
committer | Fbenas <philbeansburton@gmail.com> | 2019-06-04 18:01:33 +0100 |
commit | 779f8a323842446d0fc92f0c9ab14724d10abced (patch) | |
tree | 9a7b711a19d53d78a4152f581a62d9bdd381bf6b | |
parent | b6f2ac5debac9e9900e4fcaf270701de62d3b335 (diff) |
Make sure we capture all title tags individually with grep and then take the first with head
-rwxr-xr-x | title.bash | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |