Automatically boost cool toots on Mastodon with the Boost bot

mastodon

On the Mastodon social network, you follow some really cool Mastodon users like Carl Chenet :p and each time he talks about Bitcoin, you know it’s a great comment and you usually boost it to share with your Mastodon followers. But sometimes you have to sleep so you need to automatize that boring task.

Don’t search any more, just use the new Boost bot!

More about Boost

 Full example about using Boost

Ok, let’s stick to our example to boost toots from Carl Chenet when he’s talking about Bitcoin.

Start by installing Boost:

# pip3 install boost

We are going to create a dedicated user on your system, a dedicated directory in /etc and /var/lib to store Feed2toot configuration and data:

# adduser --home /var/lib/boost --gecos "" boost
# mkdir -p /etc/boost/credentials /var/lib/boost
# chown -R boost:root /etc/boost /var/lib/boost

Lets generate an app to authorize this app use our account. It’s a really simple process with the following command:

$ register_boost_app

Just answer the questions and the files boost_usercred.txt and boost_clientcred.txt will be created in your current work directory.

We now write the following configuration in the file /etc/boost/boost.ini:

[mastodon]
users_to_boost=carlchenet@mastodon.social
instance_url=https://mastodon.social
user_credentials=/etc/boost/credentials/boost_usercred.txt
client_credentials=/etc/boost/credentials/boost_clientcred.txt

[boost]
only_if_hashtags=bitcoin

[sqlite]
sqlitepath=/var/lib/boost/boost.db

Ok lets give some details here:

  • In the [mastodon] section
    • users_to_boost is a comma-separated list of users writing the toots you could boost
    • instance_url is the url of your own Mastodon user
    • user_credentials is the path tothe user credentials, generated by the command register_boost_ap
    • client_credentials is the path to the client credentials, generated by the command register_boost_app
  • In the [boost] section
    • only_if_hashtags defines what hashtag the toot must contain to be boosted. We use here bitcoin which is going to search for the #bitcoin hashtag
  • In the [sqlite] section
    • sqlitepath is a path to the sqlite database storing the ids of already-boosted toots

Our Boost configuration is ready. If you want to avoid boosting the last 20 entries of each user you defined, use the following command to populate the Boost database:

$ boost --populate-database --config /etc/boost/boost.ini

We are now all set. Just use the following command each time you want to boost all toots matching your criteria(s):

$ boost --config /etc/boost/boost.ini

It’s more convenient to have a line in your /etc/crontab file in order to not perform manually the previous task. We want automatize all things!

0 * * * * boost boost --config /etc/boost/boost.ini

With great powers come great responsabilities

Boost allows boosting really cool stuff, but always think about the noise for your users it can generate if you use it too much. As always while automatizing stuff, use it in a smart way and everybody will enjoy it.

… and finally

You can help the Boost Bot by donating anything through Liberaypay (also possible with cryptocurrencies). Any contribution will be appreciated. That’s a big factor motivation 😉

liberapay

One thought on “Automatically boost cool toots on Mastodon with the Boost bot

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *