note: this bot is no longer running because it was too much of a pain
what's all this then
I've got a mastodon bot running at @AbsurdistAscensions@botsin.space. Following is an explanation of how it works.
the code
#!/usr/bin/env bash
while true; do
date # to better tell what it was doing when
words="$(head -n 1 two_words.txt)" # get the next set of words
if [[ "$words" == "----" ]]; then # if it reaches the point where i stopped reviewing,
curl -d 'Review more phrases for Absurdist Ascensions!!' ntfy.sh/[REDACTED]
exit # then it will tell me about it and quit
fi
tail -n +2 two_words.txt | sponge two_words.txt # remove the words we're using from the list
phrase="$(shuf -n 1 finally.txt)" # get a random phrase to use with the words
phrase="${phrase//XYZ/$words}" # put the words into the phrase
phrase="${phrase//ABC/$(< last_words.txt)}" # if it's a phrase that uses 2 sets, use the last set
echo "$words" > last_words.txt # make current word set available as a 2nd set
echo "$phrase" # to better tell what it was doing
toot post --using AbsurdistAscensions@botsin.space "$phrase" # post the dang thing
sleep 5h
done
What is two words.txt
I ran
for i in {1..2000}; do echo $(shuf -n 2 /usr/share/dict/words | tr [a-z] [A-Z]) >> two_words.txt ; done
and started manually curating entries. Sometime I'd like to get some good wordlists and generate non sequiturs automatically; but at a rate of one post every five hours, I think this is sustainable for the time being.
What is finally.txt
It's a list of phrases that the bot can use, you can read it here. It's a bit short at the moment, go ahead and mention or DM the bot with suggestions if you want.