Add button feelings to annna. - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 84e0f621298babedbf4221847df0b631c8065df9 | |
parent 962829f3c84c457e95b4a131b570290643aba3bc | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Sat, 14 Aug 2021 21:23:08 +0200 | |
Add button feelings to annna. | |
Diffstat: | |
M annna-message-common | 9 +++++++++ | |
A button-gen | 12 ++++++++++++ | |
2 files changed, 21 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/annna-message-common b/annna-message-common | |
@@ -267,6 +267,15 @@ case "${text}" in | |
flock $HOME/bin/modules/ip-art -c "./display-file.sh ip-art.ip… | |
} & | |
;; | |
+"${botname}, I feel button.") | |
+ buri="$(button-gen)" | |
+ if [ -n "${buri}" ]; | |
+ then | |
+ annna-say -c "${channel}" "${user}, like this? ${buri}" | |
+ else | |
+ annna-sax -c "${channel}" "${user}, sorry, no feelings for you… | |
+ fi | |
+ ;; | |
"${botname}, I feel stupid.") | |
nuri=$(darwin) | |
tmpf=$(mktemp) | |
diff --git a/button-gen b/button-gen | |
@@ -0,0 +1,12 @@ | |
+#!/bin/sh | |
+ | |
+hurl https://anlucas.neocities.org/88x31Buttons.html \ | |
+ | xml2tsv 2>/dev/null \ | |
+ | grep ".*/img" \ | |
+ | cut -f 2- \ | |
+ | sed 's,src=\([^ \t]*\),\1\n,g; s,\t,,g;' \ | |
+ | sort \ | |
+ | uniq \ | |
+ | shuf -n 1 \ | |
+ | xargs -n 1 printf "https://anlucas.neocities.org/%s\n" | |
+ |