Paste archive link only if available. - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 914e54671c8a6a9998533063588547ddfe8258e2 | |
parent 7b94f880e6f89de7de271101d86ea542855d3cff | |
Author: eidolon <?> | |
Date: Thu, 10 Oct 2024 16:08:52 -0400 | |
Paste archive link only if available. | |
Signed-off-by: Annna Robert-Houdin <[email protected]> | |
Diffstat: | |
M annna-message-common | 12 +++++++++--- | |
1 file changed, 9 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/annna-message-common b/annna-message-common | |
@@ -164,9 +164,15 @@ case "${text}" in | |
nuris="text only: ${nuri}" | |
fi | |
;; | |
- *wsj.com/*|*ft.com/*|*nytimes.com/*) | |
- nuri="https://archive.is/newest/$uri" | |
- nuris="recent archive: $nuri" | |
+ *www.wsj.com/*|*www.ft.com/*|*www.nytimes.com/*) | |
+ curl -Ism 3 -o /dev/null -w '%{response_code}\n%{redirect_url}… | |
+ { | |
+ read -r resp | |
+ if [ "$resp" = "302" ]; then | |
+ read -r nuri | |
+ nuris="recent archive: $nuri" | |
+ fi | |
+ } | |
;; | |
*www.reddit.com*) | |
nuri="$(printf '%s\n' "${uri}" | sed "s;www.reddit.com;old.red… |