Ported my @covidsewage bot over to Mastodon

Every morning it posts an image with the latest Covid sewage charts for various locations around the San Francisco Bay Area - because the sewage charts are the only figures I still trust!

The sewage doesn't lie

The screenshots come from https://covid19.sccgov.org/dashboard-wastewater - here's the latest image:

The bot runs entirely from this GitHub scheduled actions workflow: https://github.com/simonw/covidsewage-bot/blob/main/.github/workflows/toot.yml

It uses my https://shot-scraper.datasette.io/ CLI screenshot automation tool and the excellent https://toot.readthedocs.io/ Mastodon CLI utility

covidsewage-bot/toot.yml at main · simonw/covidsewage-bot

The @covidsewage bot. Contribute to simonw/covidsewage-bot development by creating an account on GitHub.

GitHub
Amusingly, I found toot because I sat down to build myself a CLI tool for posting to Mastodon (an equivalent of my existing https://github.com/simonw/tweet-images tool) and checked PyPI to see if the name "toot" was available... and it had already been taken by a tool that did EXACTLY what I wanted to do
GitHub - simonw/tweet-images: Send tweets with images from the command line

Send tweets with images from the command line. Contribute to simonw/tweet-images development by creating an account on GitHub.

GitHub
Here's a TIL describing how the new Mastodon bot works - should be handy for anyone else who wants to create their own bots too: https://til.simonwillison.net/mastodon/mastodon-bots-github-actions
Building Mastodon bots with GitHub Actions and toot

Twitter [announced today](https://twitter.com/TwitterDev/status/1621026986784337922) that they'll be ending free API access for bots. My [@covidsewage](https://twitter.com/covidsewage) Twitter bot po

@simon
Thanks for sharing!

I realized my bot built with https://cheapbotsdonequick.com/ will likely die soon, along with the access to the "source code" (mostly text). Have you used this, and know of any way to migrate from there to Mastodon?

My bot https://twitter.com/homerlines just posts a random line of text from a big list, and needs to avoid obvious duplicates. I don't know how to store the necessary state with GitHub Actions...

Cheap Bots, Done Quick!

@bassistance easiest way to store state in a GitHub Actions run is to commit a text file back to the repo itself

@simon
Makes sense! I can put the text input in one file, and reference the last x published lines in another, than find a good shuffle algorithm that would also work for a song playlist...

Or just shuffle the input once, then store the current line and roll over from the end back to the beginning... (and shuffle again?)