{"id":20538885,"url":"https://github.com/btittelbach/mastodonboostbot","last_synced_at":"2025-04-14T07:51:08.858Z","repository":{"id":145219327,"uuid":"168387594","full_name":"btittelbach/MastodonBoostBot","owner":"btittelbach","description":"simple Mastodon Bot to boost all mentions of a certain hashtag of the people it's following","archived":false,"fork":false,"pushed_at":"2019-04-28T18:34:12.000Z","size":31,"stargazers_count":7,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T19:42:16.895Z","etag":null,"topics":["filter","hashtag","mastodon","mastodon-bot","retweet","social-media"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/btittelbach.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-01-30T17:48:19.000Z","updated_at":"2025-01-12T07:55:29.000Z","dependencies_parsed_at":"2023-07-07T10:31:54.104Z","dependency_job_id":null,"html_url":"https://github.com/btittelbach/MastodonBoostBot","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"87c3ae4367ea37019560d3713d7e0e650b730087"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btittelbach%2FMastodonBoostBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btittelbach%2FMastodonBoostBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btittelbach%2FMastodonBoostBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btittelbach%2FMastodonBoostBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/btittelbach","download_url":"https://codeload.github.com/btittelbach/MastodonBoostBot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248844058,"owners_count":21170486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filter","hashtag","mastodon","mastodon-bot","retweet","social-media"],"created_at":"2024-11-16T00:48:07.277Z","updated_at":"2025-04-14T07:51:08.835Z","avatar_url":"https://github.com/btittelbach.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Mastodon Bot to boost all mentions of a certain hashtag of the people it's following\n\n## Idea\n\nThe 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.\n\nAdminister your group (people whose tagged posts will be boosted) in Mastodon by following/unfollowing users.\n\nAlternatively, you can disable the follower-filter and just boost/reblog every post containing one of your hashtags.\n\n### Features\n\n- mostly 12-factor app\n    - configuration with environment variables\n    - but no package control until go1.12 is more widespread\n- easily containerized static golang executable\n- fail-fast, restart-fast\n- configure once and forget (administrate trusted followers in mastodon, not bot configuration)\n\n#### Todo\n\n- cc videos to Twitter\n- cc multiple images to Twitter\n- split longer toots into multiple tweets\n\n### Example Information Flow\n\n\u003cimg src=\"https://raw.githubusercontent.com/btittelbach/lightningtalks_mycete-mastodonboostbot-matrix/master/images/MastodonBoostBot_flow.png\" style=\"text-align:center; width:100%;\"\u003e\n\nsee also slides of lightningtalks which can be found [here](https://github.com/btittelbach/lightningtalks_mycete-mastodonboostbot-matrix)\n\n### similar software\n\n- [tootgroup](https://github.com/oe4dns/tootgroup.py)\n    - only needs to run periodically from cron while MastodonBoostBot needs to run constantly as a well defined service, otherwise it will miss a post\n    - hiding the original poster, by extracting content from direct messages, is currently not planned in MastodonBoostBot\n\n- [boost-bot](https://github.com/Gargron/boost-bot)\n    - Very similar, but does not filter by followers\n\n## Installation\n\n\n### Build\n\n    go build\n\n### Configure\n\n1. In your Mastodon account-page, create a new application in the development app\n    - with the following permissions: ```read:accounts``` ```read:statuses``` ```read:search``` ```read:follows``` ```write:conversations``` ```write:statuses``` ```push```\n2. copy ```example.env``` and fill the copy with the appropriately app-credentials\n  e.g. to ```mastodonBoostBot_config1.env```\n3. configure the hashtags you want to follow (without the leading ```#```)\n\n### Carbon Copy to Twitter\n\n1. 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)\n2. run\n ```MBB_CCTWEET_CONSUMER_KEY=___ MBB_CCTWEET_CONSUMER_SECRET=___ ./MastodonBoostBot --starttwitteroauth``` after replacing ```___```\n with your key and secret.\n3. authorize or let authorize the twitter account you want to use\n4. enter the PIN on the cmdline\n5. copy\u0026paste the resulting settings into your environment file for the service\n\n### Test locally\n\n    source \u003c(sed '/^\\s*#/d;s/\\(.\\+\\)=\\(.*\\)/export \\1=\"\\2\"/;' mastodonBoostBot_config1.env)\n    ./MastodonBoostBot --debug=ALL\n\n### Deploy\n\n1. deploy executable and config file to server of your choice\n2. adapt the service file to your paths and needs or otherwise ensure that environment variables are loaded from config-file.\n3. enable and start\n   you can easily run multiple instances with different configurations\n\n\n#### Example 1 - as user on a systemd system\n\n1. copy \u003ctt\u003eMastodonBoostBot\u003c/tt\u003e executable to \u003ccode\u003e~/bin/\u003c/code\u003e\n1. copy config to \u003ccode\u003e~/.config/mastodonBoostBot_config1.env\u003c/code\u003e\n1. \u003ccode\u003echmod 400 ~/.config/mastodonBoostBot_config1.env\u003c/code\u003e\n1. copy \u003ccode\u003euser_service/MastodonBoostBot.service\u003c/code\u003e to \u003ccode\u003e~/.local/share/systemd/user/\u003c/code\u003e\n1. \u003ccode\u003esystemctl --user start MastodonBoostBot.service\u003c/code\u003e\n1. \u003ccode\u003esystemctl --user enable MastodonBoostBot.service\u003c/code\u003e\n\n\n#### Example 2 - systemwide on a systemd system\n\n1. \u003ccode\u003emkdir -p /opt/MastodonBoostBot/\u003c/code\u003e\n1. \u003ccode\u003eadduser mastodonbot\u003c/code\u003e\n1. \u003ccode\u003echown mastodonbot -R /opt/MastodonBoostBot/\u003c/code\u003e\n1. copy \u003ctt\u003eMastodonBoostBot\u003c/tt\u003e executable to \u003ccode\u003e/opt/MastodonBoostBot/\u003c/code\u003e\n1. copy config to \u003ccode\u003e/opt/MastodonBoostBot/mastodonBoostBot_config1.env\u003c/code\u003e\n1. \u003ccode\u003echmod 400 /opt/MastodonBoostBot/mastodonBoostBot_config1.env\u003c/code\u003e\n1. copy \u003ccode\u003euser_service/MastodonBoostBot.service\u003c/code\u003e to \u003ccode\u003e/etc/systemd/system\u003c/code\u003e\n1. adapt paths and config in \u003ctt\u003eMastodonBoostBot.service\u003c/tt\u003e\n    a. add \u003ccode\u003eUser=mastodonbot\u003c/code\u003e\n    a. \u003ccode\u003eExecStart\u003c/code\u003e\n    a. \u003ccode\u003eEnvironmentFile\u003c/code\u003e\n    a. change \u003ccode\u003eWantedBy\u003c/code\u003e to \u003ccode\u003emulti-user.target\u003c/code\u003e or whatever you start your services with\n    a. comment in additional protections. possibly try chrooting the service in \u003ccode\u003e/opt/MastodonBoostBot\u003c/code\u003e\n1. \u003ccode\u003esystemctl start MastodonBoostBot.service\u003c/code\u003e\n1. \u003ccode\u003esystemctl enable MastodonBoostBot.service\u003c/code\u003e\n\n\n## Design\n\n### Algorithm\n\n- follow stream of configured list of hashtags using [StreamingAPI](https://github.com/tootsuite/documentation/blob/master/Using-the-API/Streaming-API.md)\n- for all received [status](https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#status)\n    - Boost Status if the following optional checks pass\n        - is status public (```visibility==public```)\n        - not already reblogged (```reblogged==false||reblogged==nil```)\n        - filter for configured hashtags\n        - conversation unblocked? (```blocked==false||blocked==nil```)\n        - original status or already reblogged? (```reblog==nil```)\n        - verify it is a user we follow.\n            - get [relationship](https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#relationship) with the posting [account](https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#account) (```GET /api/v1/accounts/relationships {id:status.account.id}```)\n            - verify we follow this account (\u003ctt\u003efollowing==true \u0026\u0026 blocking==false \u0026\u0026 muting==false\u003c/tt\u003e)\n        - considered but not implemented: check against configured list of users (though that would move user-management from website to daemon-configfile)\n        - planned but not implemented: filter for addtional content in status-text\n\n\n- considered but not implemented: read \"private\" messages and toot them\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtittelbach%2Fmastodonboostbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbtittelbach%2Fmastodonboostbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtittelbach%2Fmastodonboostbot/lists"}