// Install Mastodon.py
user@linux: ~$ sudo pip install mastodon.py
// Create a Mastodon application
- Log into Mastodon
- Click on "New Application"
- Choose a name and let the rest as it is. Click on "Submit"
- Click on the name of the app you've just created to get to your tokens
- Copy the string behind "Your access token" into a new file and name it "token.secret"
// The Code
- Create a new file and name it e.g. "bot.py"
- Add the following code
- Customize it
Note: Change the instance name in the code to the instance the application was made on.
// Run the code
user@linux: ~$ python3 bot.py
Note: Please remember: please don't use this code to spam the Fediverse. You could test your bot on https://botsin.space/.