Show link to text-only NPR pages - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 7141cf206b96263253973f17837a2bbf4efc638b | |
parent 99f37ea8067acb04d580cb87979e39357c2bf6ad | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 4 Aug 2020 22:12:18 +0200 | |
Show link to text-only NPR pages | |
Standard parsing is blocked by data-protection splash page, for example: | |
https://choice.npr.org/index.html?origin=https://www.npr.org/ | |
Signed-off-by: Annna Robert-Houdin <[email protected]> | |
Diffstat: | |
M annna-start-services | 8 ++++++++ | |
1 file changed, 8 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/annna-start-services b/annna-start-services | |
@@ -131,6 +131,14 @@ annna_common() { | |
nuris="$(printf '%s' "${uri}" | sed 's/blob/ra… | |
nocuri=0 | |
;; | |
+ *www.npr.org/*) | |
+ post="$(printf '%s\n' "${uri}" | cut -d / -f 7… | |
+ if [ -n "${post}" ]; | |
+ then | |
+ nuri="https://text.npr.org/s.php?sId=$… | |
+ nuris="text only: ${nuri}" | |
+ fi | |
+ ;; | |
*) | |
mimetype="$(file -b --mime-type "${tmpf}")" | |
case "${mimetype}" in |