diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-06-04 18:01:53 +0000 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-06-04 18:01:53 +0000 |
commit | 6f06a1a49c04f4a4e01744bb95d6a1c3732611d4 (patch) | |
tree | 9a7b711a19d53d78a4152f581a62d9bdd381bf6b | |
parent | b6f2ac5debac9e9900e4fcaf270701de62d3b335 (diff) | |
parent | 779f8a323842446d0fc92f0c9ab14724d10abced (diff) |
Merge branch 'master' into 'master'
Make sure we capture all title tags individually with grep and then take the first with head
See merge request l_bratch/blatitle!1
-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 |