Add Cities: Bitreich support to annna. - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit e489a6cc3673be7a03014d163b53afb396990d07 | |
parent bc428e9d016c26aef357a3cd5ff076d3f8041812 | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Wed, 13 Apr 2022 18:36:13 +0200 | |
Add Cities: Bitreich support to annna. | |
Diffstat: | |
M annna-message-common | 9 +++++++++ | |
A this-city-does-not-exist | 7 +++++++ | |
2 files changed, 16 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/annna-message-common b/annna-message-common | |
@@ -760,6 +760,15 @@ case "${text}" in | |
"${botname}, please clap for me.") | |
annna-say -s "${server}" -c "${channel}" "${user}, *clap* *clap* *clap… | |
;; | |
+"${botname}, which city does not exist?") | |
+ cityuri="$(this-city-does-not-exist)" | |
+ if [ -n "${cityuri}" ]; | |
+ then | |
+ annna-say -s "${server}" -c "${channel}" "${user}, this one: $… | |
+ else | |
+ annna-say -s "${server}" -c "${channel}" "${user}, none." | |
+ fi | |
+ ;; | |
"For humanity!") | |
annna-say -s "${server}" -c "${channel}" "${user}, for humanity!" | |
;; | |
diff --git a/this-city-does-not-exist b/this-city-does-not-exist | |
@@ -0,0 +1,7 @@ | |
+#!/bin/sh | |
+ | |
+curl -s http://thiscitydoesnotexist.com/ \ | |
+ | xml2tsv 2>/dev/null \ | |
+ | grep center/img \ | |
+ | sed 's,.*src=\.\([^\t]*\).*,http://thiscitydoesnotexist.com\1,' | |
+ |