The original usecase is to collect all the toots mentioning one of a set of hashtags by a group of people and re-toot/boost their stati in a single account. The single account can be displayed on a kiosk screen and be the public face of a organisation/group/hackerspace. You can use MastodonBoostBot to emulate groups in Mastodon. Users can post as an organisation account without requiring login credentials and without loosing the information about the original poster.
Administer your group (people whose tagged posts will be boosted) in Mastodon by following/unfollowing users.
Alternatively, you can disable the follower-filter and just boost/reblog every post containing one of your hashtags.
- mostly 12-factor app
- configuration with environment variables
- but no package control until go1.12 is more widespread
- easily containerized static golang executable
- fail-fast, restart-fast
- configure once and forget (administrate trusted followers in mastodon, not bot configuration)
- cc videos to Twitter
- cc multiple images to Twitter
- split longer toots into multiple tweets
see also slides of lightningtalks which can be found here
-
- only needs to run periodically from cron while MastodonBoostBot needs to run constantly as a well defined service, otherwise it will miss a post
- hiding the original poster, by extracting content from direct messages, is currently not planned in MastodonBoostBot
-
- Very similar, but does not filter by followers
go build
- In your Mastodon account-page, create a new application in the development app
- with the following permissions:
read:accounts
read:statuses
read:search
read:follows
write:conversations
write:statuses
push
- with the following permissions:
- copy
example.env
and fill the copy with the appropriately app-credentials e.g. tomastodonBoostBot_config1.env
- configure the hashtags you want to follow (without the leading
#
)
- You will need an App Consumer Key and App Consumer Secret from a Twitter Developer (or get a Twitter Developer to run MastodonBoostBot for you)
- run
MBB_CCTWEET_CONSUMER_KEY=___ MBB_CCTWEET_CONSUMER_SECRET=___ ./MastodonBoostBot --starttwitteroauth
after replacing___
with your key and secret. - authorize or let authorize the twitter account you want to use
- enter the PIN on the cmdline
- copy&paste the resulting settings into your environment file for the service
source <(sed '/^\s*#/d;s/\(.\+\)=\(.*\)/export \1="\2"/;' mastodonBoostBot_config1.env)
./MastodonBoostBot --debug=ALL
- deploy executable and config file to server of your choice
- adapt the service file to your paths and needs or otherwise ensure that environment variables are loaded from config-file.
- enable and start you can easily run multiple instances with different configurations
- copy MastodonBoostBot executable to
~/bin/
- copy config to
~/.config/mastodonBoostBot_config1.env
chmod 400 ~/.config/mastodonBoostBot_config1.env
- copy
user_service/MastodonBoostBot.service
to~/.local/share/systemd/user/
systemctl --user start MastodonBoostBot.service
systemctl --user enable MastodonBoostBot.service
mkdir -p /opt/MastodonBoostBot/
adduser mastodonbot
chown mastodonbot -R /opt/MastodonBoostBot/
- copy MastodonBoostBot executable to
/opt/MastodonBoostBot/
- copy config to
/opt/MastodonBoostBot/mastodonBoostBot_config1.env
chmod 400 /opt/MastodonBoostBot/mastodonBoostBot_config1.env
- copy
user_service/MastodonBoostBot.service
to/etc/systemd/system
- adapt paths and config in MastodonBoostBot.service
a. add
User=mastodonbot
a.ExecStart
a.EnvironmentFile
a. changeWantedBy
tomulti-user.target
or whatever you start your services with a. comment in additional protections. possibly try chrooting the service in/opt/MastodonBoostBot
systemctl start MastodonBoostBot.service
systemctl enable MastodonBoostBot.service
-
follow stream of configured list of hashtags using StreamingAPI
-
for all received status
- Boost Status if the following optional checks pass
- is status public (
visibility==public
) - not already reblogged (
reblogged==false||reblogged==nil
) - filter for configured hashtags
- conversation unblocked? (
blocked==false||blocked==nil
) - original status or already reblogged? (
reblog==nil
) - verify it is a user we follow.
- get relationship with the posting account (
GET /api/v1/accounts/relationships {id:status.account.id}
) - verify we follow this account (following==true && blocking==false && muting==false)
- get relationship with the posting account (
- considered but not implemented: check against configured list of users (though that would move user-management from website to daemon-configfile)
- planned but not implemented: filter for addtional content in status-text
- is status public (
- Boost Status if the following optional checks pass
-
considered but not implemented: read "private" messages and toot them