Downloading Tootbot and installing dependencies / requirements

The easiest way to use Tootbot is by installing from PyPi using pipx or pip.

I highly recommend using pipx if your system supports it. Installing Tootbot with pipx is as simple as typing the following into a command line / terminal window:

pipx install tootbot

This command will download and install tootbot and all its dependencies / requirements from PyPi

Settings

All settings are expected to be defined in the config.ini file in the current directory. If you are starting from scratch you can create a sample config.ini file using the command line:

tootbot_create_config

This will create a config.ini file in the current directory that you now need to edit to add your settings.

Settings in the config file

All settings for the bot can be found in the config.ini file. As an example you can look at the Showcase Config for Catsnkittens used for the showcase account @catsnkittens@botsin.space. Open the file in any text editor and perform the following tasks:

  1. Define your sources. See Defining Sources for Tootbot for details on how to do that.

  2. By default, the bot will wait at least 600 seconds (10 minutes) between posts to prevent spamming. You can change this by editing the DelayBetweenTweets setting in the [BotSettings] section.

  3. By default, the bot will only look at the top 10 ‘hot’ posts in a subreddit. You can change this by editing the PostLimit setting in the [BotSettings] section.

  4. You can enable or disable NSFW posts and self-posts, by changing NSFWPostsAllowed and SelfPostsAllowed to true or false.

  5. If you want Tootbot to only post media (images, GIFs, GIFV files, etc), set MediaPostsOnly to true.

  6. Add the name of your instance (e.g. mastodon.social) to InstanceDomain in the [Mastodon] section.

Entering API information

Next, you need to run Tootbot to setup API access with Reddit, Imgur, and Mastodon. Below is an explanation for what each service is used for:

  • The Reddit API is used to grab posts from subreddits.

  • The Imgur API is used to grab direct image URLs from gallery/album links.

  • Mastodon API access is required for posting to social media.

Open the command line/terminal and set your directory to the Tootbot folder. Then type this command:

tootbot

After Tootbot starts up, it will begin asking for API keys. You only have to do this process once.

Setting up Reddit API access

  1. Log into Reddit, go to your app preferences, and click the ‘Create a new application’ button at the bottom.

  2. Select ‘script’ as the application type, and click the ‘Create app’ button.

  3. You should see a Reddit agent string (underneath ‘personal use script’) and an agent secret. Paste these into Tootbot when it asks for them, pressing Enter after each one.

Image of Reddit Api keys

If you ever want to re-setup Reddit access (if you make a new account, for example), just delete the reddit.secret file and run Tootbot again.

Setting up Imgur API access

  1. Sign into Imgur with your account, or make one if you haven’t already.

  2. Register an application by adding a client and choose ‘OAuth 2 authorization without a callback URL’ as the app type.

  3. Imgur will give you a Client ID and Client Secret. Paste these into Tootbot when it asks for them, pressing Enter after each one.

If you ever want to re-setup Imgur access (if you make a new account, for example), just delete the imgur.secret file and run Tootbot again.

Setting up Mastodon API access

Go to the special authorization URL of your Fediverse instance displayed by tootbot. Follow the instructions on that site to generate an Authorization Code. Finally, supply that Authorization Code to tootbot.

If you ever want to re-setup Mastodon access (if you make a new account, for example), just delete the mastodon.secret file and run Tootbot again.

Running Tootbot

Now that you have everything set up, Tootbot should start posting to Mastodon. For more details read Installing Tootbot.

Once you’re done making a bot account with Tootbot, please add it to the list of Accounts using Tootbot!