A system for randomly timed bot posts
Awhile ago I made a very simple bot -- @WhatNewDevilry, which simply posts one of my favorite scenes/lines from Lord of The Rings:
Instead of posting on a scheduled interval, I wanted to add some randomness to the posting schedule. I decided to do this by using the Mastodon API's scheduled tweet system. Basically, the bot code checks to see if there's a scheduled tweet for the account. If not, it schedules one at a random time in the future. The script runs every hour or so to keep checking the status. Meanwhile, Mastodon itself will post the scheduled toot at the proper time.
The code is pretty basic and looks an awful lot like this: