Python program to fill a mastodon timeline with randomized toots. If you want to see what this creates, have a look at the [local timeline on always.grumpy.world](https://always.grumpy.world/public/local).
The idea is to generate some somewhat realistic looking users, posts, interactions, etc. This will help fill up a local timeline and provide test data and a playground in which to try new features. I built this because I want to test a few functions that would look at the raw, underlying database on a mastodon instance. But I need to get some data into that database so that I can see what it looks like.
Follow the instructions for unning [the server-util make-users.py](server-util/README.md). You'll copy that onto your mastodon server, run it once to generate a `users.toml` file that contains plaintext user names and passwords for your test users, and then copy that file to where you want it to run.
You do that just once.
Then copy the `users.toml` file to the location where you have checked out `tootapalooza`.
Install the `tootapalooza` command into your path so you can invoke it. Run `pip install -e .`
You need to run this in a location that can make API calls to your mastodon instance. I say it this way because you might have a load balancer, a private network, etc. so that running this ON the mastodon server itself isn't desirable. There is no reason to run this directly on the mastodon server. You can, but there's no compelling reason to do that. It makes API calls over the public Internet.
Assuming everything is up to date, all your files initialised with correct values, you can just run `tootapalooza --once users.toml`. Every user in your `users.toml` file will pick a random action and do one random action.
## Weights and random actions
If you look in the `random_interactions()` method, you'll see a table of weights. (Example shown below). Those weights are fed into Python's [random.choices()](https://docs.python.org/3/library/random.html#random.choices) function and that's how it picks the actions to take. In the example below, the weights sum to 33. `unfollow_random()` has a weight of 1, so it has a 1 in 33 (3%) chance of happening. Whereas `reply_random_local` has a weight of 4, so it has a 4 in 33 (12%) chance of happening. Adjust the weights to get the blend of traffic you want. If you don't want an action to happen at all, set its weight to 0.
I intend to make this a multi-threaded daemom that will sleep a little bit, wake up and do a few random actions, go back to sleep, etc. One thread per user, with a bit of randomness on the sleep times. It will just run in the background, generating test data slowly over time.