more crimefighting - 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 dd675908db057161b0d1bce1ea3a61b86c8003e9 DIR parent 39cf80b3dc7cf15b8b01520e2ca17df52762f4a7 HTML Author: ben <ben@0x1bi.net> Date: Mon, 8 Feb 2021 13:13:51 -0500 more crimefighting Signed-off-by: Annna Robert-Houdin <annna@bitreich.org> Diffstat: M annna-start-services | 3 ++- M theyfightcrime | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) --- DIR diff --git a/annna-start-services b/annna-start-services @@ -245,7 +245,8 @@ annna_common() { annna-say -c "${channel}" "${user}, ${rejection}" ;; "${botname}, who fights crime?") - crimefighter="$(theyfightcrime)" + partner=$(echo $brmembers | awk '{for (i = 1; i < NF; i++) print $i}' | sort -R | sed 1q) + crimefighter="$(theyfightcrime ${user} ${partner})" annna-say -c "${channel}" "${crimefighter}" ;; "${botname}, please give me a commit message.") DIR diff --git a/theyfightcrime b/theyfightcrime @@ -1,3 +1,13 @@ #!/bin/sh -curl -s https://theyfightcrime.org/ | grep -Eo '[^>]+They fight crime!' +duo=$(curl -s https://theyfightcrime.org/ | grep -Eo '[^>]+They fight crime!') + +if [ $(echo $1 | wc -m) -gt 1 ]; then + duo=$(echo $duo | sed "s/He's/$1 is/g") +fi + +if [ $(echo $2 | wc -m) -gt 1 ]; then + duo=$(echo $duo | sed "s/She's/$2 is/g") +fi + +echo $duo