Add Indian health advices to annna. - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 534ef3a195849b6e8e028c9c2dd0d4c71748d3ab | |
parent 4f0b35ad38216a7c4a80f9148704ad3e118535bb | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Sun, 27 Nov 2022 14:02:20 +0100 | |
Add Indian health advices to annna. | |
Diffstat: | |
M annna-message-common | 7 +++++++ | |
A health-advice | 13 +++++++++++++ | |
2 files changed, 20 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/annna-message-common b/annna-message-common | |
@@ -841,6 +841,13 @@ case "${text}" in | |
"${ircuser}, sudo please make me a sandwich"*) | |
annna-say -s "${server}" -c "${channel}" "Here is your sandwich." | |
;; | |
+"${ircuser}, I feel unsure about my health.") | |
+ healthadvice="$(health-advice)" | |
+ if [ -n "${healthadvice}" ]; | |
+ then | |
+ annna-say -s "${server}" -c "${channel}" "${user}, ${healthadv… | |
+ fi | |
+ ;; | |
"${ircuser}, bonjour !") | |
annna-say -s "${server}" -c "${channel}" "${user}, bonjour !" | |
;; | |
diff --git a/health-advice b/health-advice | |
@@ -0,0 +1,13 @@ | |
+#!/bin/sh | |
+ | |
+healthuri="https://www.aryavaidyasala.com/" | |
+ | |
+curl -s $healthuri \ | |
+ | xml2tsv 2>/dev/null \ | |
+ | grep marquee/b/i \ | |
+ | cut -f 4 \ | |
+ | sed 's, ,,g' \ | |
+ | sed 's,\\n,,g' \ | |
+ | sed 's,\\t,,g' \ | |
+ | shuf -n 1 | |
+ |