Add WolframAlpha support to annna. - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 28690f24a1affd0c573ec0651bb27c6d1fd21ecd | |
parent 5071888104a90222b8bdbc1c803ec990d8eef9b5 | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Sun, 12 Apr 2020 17:56:56 +0200 | |
Add WolframAlpha support to annna. | |
Diffstat: | |
M annna-start-services | 25 +++++++++++++++++++++++++ | |
1 file changed, 25 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/annna-start-services b/annna-start-services | |
@@ -178,6 +178,31 @@ then | |
esac | |
annna-say -c '#bitreich-en' "${purl}" | |
;; | |
+ "${botname}, wolfram is "*) | |
+ word="$(printf "%s\n" "${text}" | cut -c 19- | sed 's,… | |
+ case "$word" in | |
+ *\?) | |
+ word="$(printf "%s\n" "${word}" | cut -c -"$((… | |
+ ;; | |
+ esac | |
+ | |
+ purl="" | |
+ dresult="$(printf "/wolfram\t%s\r\n" "${word}" \ | |
+ | nc magical.fish 70 \ | |
+ | awk '/iAnswer:/,/iAsk/' \ | |
+ | grep -v '^i ' \ | |
+ | head -n -1 \ | |
+ | tail -n +2 \ | |
+ | sed 's,i\(.*\)fake\texample.com.*,\1,')" | |
+ | |
+ if [ -n "$dresult" ]; | |
+ then | |
+ purl="$(printf "%s" "${dresult}" | /br/bin/bit… | |
+ else | |
+ purl="No matches found." | |
+ fi | |
+ annna-say -c '#bitreich-en' "${purl}" | |
+ ;; | |
esac | |
case "${text}" in |