Add abandonware game bored support to annna. - annna - Annna the nice friendly bot.
HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
---
DIR commit bb90b3990d0b00443713a4830cc1bf4d91254a55
DIR parent a2718601cce2df3fe8f995d3491730b307c2583f
HTML Author: Annna Robert-Houdin <annna@bitreich.org>
Date: Mon, 27 Jul 2020 14:16:01 +0200
Add abandonware game bored support to annna.
Diffstat:
A abandonware-random-game | 9 +++++++++
M annna-start-services | 11 ++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
---
DIR diff --git a/abandonware-random-game b/abandonware-random-game
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+hurl https://www.abandonwaredos.com/random-games.php \
+ | xml2tsv 2>/dev/null \
+ | grep 'li/div/div/a' \
+ | sed 's,.*href=\([^ \t]*\)[ \t]*\([^\t]*\),\2 ( https://www.abandonwaredos.com\1 ),; s,\\t,,g;' \
+ | shuf \
+ | head -n 1
+
DIR diff --git a/annna-start-services b/annna-start-services
@@ -323,7 +323,16 @@ annna_common() {
"${botname}, please turn me on.")
annna-say -c "${channel}" "☞ ⏻ ${user}"
;;
- "${botname}, I'm bored")
+ "${botname}, I'm game bored.")
+ gamelink="$(abandonware-random-game)"
+ if [ -z "${gamelink}" ];
+ then
+ annna-say -c "${channel}" "${user}, sorry I have found nothing for you."
+ else
+ annna-say -c "${channel}" "${user}, have you tried ${gamelink} ?"
+ fi
+ ;;
+ "${botname}, I'm gopher bored.")
randomlink="$(/br/bin/bitreich-lawn-random-link)"
linktype="$(printf "%s\n" "${randomlink}" | cut -d '|' -f1 | cut -c2-)"
linktext="$(printf "%s\n" "${randomlink}" | cut -d '|' -f2)"