Only explictly show and download URI content. - annna - Annna the nice friendly bot. HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/ DIR Log DIR Files DIR Refs DIR Tags DIR README --- DIR commit 58865cceb90c5d440e54de4454b99aa740ae1419 DIR parent 124bb8e8c0641c945d6077cffd406b993f932d85 HTML Author: Annna Robert-Houdin <annna@bitreich.org> Date: Fri, 5 Jun 2020 22:03:56 +0200 Only explictly show and download URI content. Diffstat: M annna-start-services | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) --- DIR diff --git a/annna-start-services b/annna-start-services @@ -58,8 +58,8 @@ annna_common() { nuri="" # html2text content. curi="" - # Set to 1, if the URI is not proper for html2text. - nocuri=0 + # Set to 0, if some URI content should be shown. + nocuri=1 # Screenshot. suri="" @@ -83,6 +83,7 @@ annna_common() { if expr "${uri}" : '^https*://[^/]*youtu\(\.be\|be\..\{2,3\}\)/' then sturi="$(subtitle-paste "${uri}")" + nocuri=0 fi case "${uri}" in @@ -90,19 +91,20 @@ annna_common() { nuri="$(printf "%s\n" "${uri}" | sed 's;\(mobile\.\)\{0,1\}twitter\.com;nitter\.net;')" suri="$(screenshot-paste "${nuri}")" nuri="nitter: ${nuri} " + nocuri=0 ;; *en.wikipedia.org/wiki*) if ! regeximatch "$uri" '\.(jpg,bmp,gif,png,tiff,avi,mp4,webm,mkv,pdf,ps,eps)$'; then nuri="$(printf 'gopherpedia: %s \n' "${uri}" | sed "s;.*en.wikipedia.org/wiki;gopher://gopherpedia.com/0;")" curi="$(9 htmlfmt < "${tmpf}" | /br/bin/bitreich-paste)" - else - nocuri=1 + nocuri=0 fi ;; *www.reddit.com*) nuri="$(printf 'old.reddit: %s \n' "${uri}" | sed "s;www.reddit.com;old.reddit.com;")" curi="$(9 htmlfmt < "${tmpf}" | /br/bin/bitreich-paste)" + nocuri=0 if [ -n "${uri#*www.reddit.com/r/*}" ]; then subreddit="$(printf '%s\n' "${uri}" | cut -d / -f 5)" @@ -116,6 +118,9 @@ annna_common() { nuri="${nuri}; gopherdit: ${guri} " fi ;; + *.html|*.HTML|*.txt|*.TXT|*/) + nocuri=0 + ;; esac if [ $titleend -eq 0 ];