Parse english wikipedia links as gopherpedia - annna - Annna the nice friendly bot.
(HTM) git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
---
(DIR) commit e2bec909ca2e0c93b87a29373cab51fae11ecaf6
(DIR) parent 7994509ed76773817bbdfa4321de66074a31f5a1
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Fri, 8 May 2020 20:20:36 +0200
Parse english wikipedia links as gopherpedia
Signed-off-by: Annna Robert-Houdin <annna@bitreich.org>
Diffstat:
M annna-start-services | 9 +++++++++
1 file changed, 9 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/annna-start-services b/annna-start-services
@@ -29,6 +29,10 @@ hashtagcount() {
wc -l ${hashtagfile} | cut -d' ' -f 1
}
+regeximatch() {
+ printf '%s' "$1" | grep -i -E -q "$2"
+}
+
# Permissions
[ -d ${iiroot} ] && chmod o+rx ${iiroot}
[ -d ${iibase} ] && chmod o+rx ${iibase}
@@ -131,6 +135,11 @@ then
annna-say -c '#bitreich-en' "nitter: ${nurl}"
;;
+ *en.wikipedia.org/wiki*)
+ if ! regeximatch "$uri" '\.(jpg,bmp,gif,png,tiff,avi,mp4,webm,mkv,pdf,ps,eps)$'; then
+ nurl="$(printf '%s\n' "${uri}" | sed "s;.*en.wikipedia.org/wiki;gopher://gopherpedia.com/${type};")"
+ annna-say -c '#bitreich-en' "gopherpedia: ${nurl}"
+ fi
*)
spurl=""
;;