Adjust for recent updates - gophercgis - Collection of gopher CGI/DCGI for geomyidae (HTM) hg clone https://bitbucket.org/iamleot/gophercgis (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) changeset e5c40de552e5b768e213f7e521f59f697207461a (DIR) parent 9e0373a7584fb3015592cf627d718dcd2cfce8ff (HTM) Author: Leonardo Taccari <iamleot@gmail.com> Date: Sun, 7 Jul 2019 11:57:52 Adjust for recent updates (Only */f/* links works ATM, */s/* still doesn't work.) Diffstat: technologyreview/article.cgi | 32 ++++---------------------------- 1 files changed, 4 insertions(+), 28 deletions(-) --- diff -r 9e0373a7584f -r e5c40de552e5 technologyreview/article.cgi --- a/technologyreview/article.cgi Sun Jul 07 11:36:48 2019 +0200 +++ b/technologyreview/article.cgi Sun Jul 07 11:57:52 2019 +0200 @@ -10,34 +10,10 @@ { awk ' - /<div class="article-social-list /,/<\/div>/ { - next - } - /^<div class="l-automated-trending--ordered" /,/^<\/div>/ { - next - } - /^<div class="l-automated-related--single">/,/^<\/div>/ { - next - } - /<div class="callout--tagged-event-promo"/,/<\/div>/ { - next - } - /^<div class="l-cta--left">/,/^<\/div>/ { - next - } - /^<figure class="l-magazine-promo"/,/^<\/figure>/ { - next - } - /<div class="adunit /,/<\/div>/ { - next - } - - /<div class="article-enlarge__modal">/ { - exit 0 - } - { - print + if (match($0, /<div class="jsx-[0-9]+ storyFooter">/)) { + print substr($0, 1, RSTART - 1) + } } ' @@ -47,7 +23,7 @@ url=$2 curl -Lgs -- "${url}" | - { xmllint --html --format --xpath '//main' - 2>/dev/null ; } | + { xmllint --html --format --xpath '//div[@id="content"]' - 2>/dev/null ; } | filter_html | html_to_text