Add button feelings to annna. - 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 84e0f621298babedbf4221847df0b631c8065df9
 (DIR) parent 962829f3c84c457e95b4a131b570290643aba3bc
 (HTM) Author: Annna Robert-Houdin <annna@bitreich.org>
       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(-)
       ---
 (DIR) 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.ipart"
                } &
                ;;
       +"${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 today."
       +        fi
       +        ;;
        "${botname}, I feel stupid.")
                nuri=$(darwin)
                tmpf=$(mktemp)
 (DIR) 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"
       +