agafnd

here's another one of my incredibly simple bots

This bot riffs on the line "Ain't no rule that says a dog can't play basketball" at @AirBudLogic@botsin.space. Its list of animals is here (which I slightly modified from this list I found) and its list of sports is here (modified from Wikipedia's list of ball games). (I considered using Wikipedia's list of all sports instead, but it turns out that most of those, for example "swimming", don't really work with the "play" adjective.)

the code

#!/usr/bin/env bash

while true; do
    date # prints out a timestamp for monitoring purposes

    animal=$(shuf -n 1 animals.txt)

    # This part checks if the animal name starts with a vowel and puts "a" or "an" in front as necessary
    case ${animal:0:1} in
        a | e | i | o | u) animal="an $animal" ;;
        *) animal="a $animal" ;;
    esac

    phrase="Ain't no rule that says $animal can't play $(shuf -n 1 sports.txt)."
    echo "$phrase"
    # "pip install toot" my beloved
    ~/.local/bin/toot post --using AirBudLogic@botsin.space "$phrase"

    sleep 6h
done

It just runs in a tmux window. Nothing fancy because this is about all I know how to make the computer do