Introduction
Introduction Statistics Contact Development Disclaimer Help
Make annna-meme-recommend an external script for experiments. - annna - Annna t…
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6…
Log
Files
Refs
Tags
README
---
commit a24a5499786a503bf1ec6f6028f7e5bc0698f29b
parent 17dc6eb1db93e99ce26ad2dc65dbbf54988c02e0
Author: Annna Robert-Houdin <[email protected]>
Date: Sun, 7 Aug 2022 18:30:13 +0200
Make annna-meme-recommend an external script for experiments.
Diffstat:
A annna-meme-recommend | 19 +++++++++++++++++++
M annna-message-common | 6 +-----
2 files changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/annna-meme-recommend b/annna-meme-recommend
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+if [ $# -lt 1 ];
+then
+ printf "usage: %s hashtag\n" "$(basename "$0")" >&2
+ exit 1
+fi
+
+export PATH="$HOME/bin:$PATH"
+
+hashtagfile="$HOME/bin/modules/hashtags/hashtags.txt"
+
+hashtag="$1"
+
+agrep -i -1 "^#${hashtag} " "${hashtagfile}" \
+ | head -n 5 \
+ | cut -d' ' -f 1 \
+ | tr "\n" " "
+
diff --git a/annna-message-common b/annna-message-common
@@ -1087,11 +1087,7 @@ do
then
annna-say -s "${server}" -c "${channel}" "${tagline% *}: ${tag…
else
- # Use the special agrep -1 to find similar memes.
- didyoumean="$(agrep -i -1 "^#${tag} " "${hashtagfile}" \
- | head -n 5 \
- | cut -d' ' -f 1 \
- | tr "\n" " ")"
+ didyoumean="$(annna-meme-recommend)"
if [ -n "${didyoumean}" ];
then
annna-say -c "${server}" -c "${channel}" "Did you mean…
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.