Source code for the very silly bot deployed at @[email protected].
This codebase includes the Mastodon client and "Fruit Machine" image generator for the aforementioned bot.
As configured, the fruit machine symbols are set to use the fabulous Mutant Standard, an alternative emoji set with great principles, and a highly readable and all around lovely design language.
If you like what you see, please support their work through donations or get yourself good merch from them.
Check the official website for the license of the emoji.
The Mastodon client is built for the purpose of this bot, using Mastodon.py (PyPI).
- Python 3.6.
The bot's behaviour can be configured through data/resources.json
.
First you need to populate the resources/emoji/
directory with a structure of
images as generated by orxporter.
Check the directory's README for more details.
Then to generate a Fruit Machine locally:
$ ./bin/fruitmachine -o <path_for_image>
The standard output will show a status and image description.
To post to Mastodon, you need to set up the client by one of the following ways:
- Set the
FRUITMACHINE_CLIENT_ID
,FRUITMACHINE_CLIENT_SECRET
andFRUITMACHINE_ACCESS_TOKEN
environment variables with the values given on the Settings > Development > Your application interface of your Mastodon instance; - Create a file named
.ENV
in the root directory of the project, with the same variables as above in the formatvariable_name=value
, one per line. - Create two text files,
data/client_cred.secret
anddata/user_cred.secret
. The first file should have the "Client ID" in the first line, and the "Client Secret" in second line; the second file needs to have the "Access Token" in the first line.
Then just use:
$ ./bin/fruitmachine
and a fruit machine will be posted to the account. You can use the -D
switch
to print "debug" data, and the post's visibility will be set to direct
, i.e.,
only the account posting will be able to see it.
The code is licensed under an ISC license. Check LICENSE
for
details.
Check Mutant Standard's homepage for the emoji's license.
The Fruit Machine graphics are licensed under a Creative Commons Attribution 4.0 International License.