{"id":31570392,"url":"https://github.com/rondevhub/mastohashbot","last_synced_at":"2026-04-19T03:02:29.460Z","repository":{"id":317190127,"uuid":"1066347771","full_name":"RonDevHub/MastoHashBot","owner":"RonDevHub","description":"MastoHashBot is a lightweight automation bot for Mastodon. It automatically searches for posts (toots) containing specific hashtags and boosts them. The bot ensures that no post is boosted twice by storing processed IDs in a JSON file and also cleans up old entries after a configurable period of time.","archived":false,"fork":false,"pushed_at":"2025-09-29T11:28:59.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-09T04:26:43.364Z","etag":null,"topics":["fediverse","fediverse-bot","mastodon","mastodon-bot","opensource"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/RonDevHub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["RonDevHub"],"patreon":null,"open_collective":null,"ko_fi":"rondev","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"rondev","thanks_dev":"gh/rondevhub","custom":null}},"created_at":"2025-09-29T11:09:03.000Z","updated_at":"2025-09-29T11:29:03.000Z","dependencies_parsed_at":"2025-09-29T13:24:46.638Z","dependency_job_id":"1e0aa4ce-f107-4492-882b-58ef37ef1bb8","html_url":"https://github.com/RonDevHub/MastoHashBot","commit_stats":null,"previous_names":["rondevhub/mastohashbot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RonDevHub/MastoHashBot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RonDevHub%2FMastoHashBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RonDevHub%2FMastoHashBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RonDevHub%2FMastoHashBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RonDevHub%2FMastoHashBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RonDevHub","download_url":"https://codeload.github.com/RonDevHub/MastoHashBot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RonDevHub%2FMastoHashBot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31992822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["fediverse","fediverse-bot","mastodon","mastodon-bot","opensource"],"created_at":"2025-10-05T12:22:19.835Z","updated_at":"2026-04-19T03:02:29.453Z","avatar_url":"https://github.com/RonDevHub.png","language":"PHP","funding_links":["https://github.com/sponsors/RonDevHub","https://ko-fi.com/rondev","https://buymeacoffee.com/rondev","https://thanks.dev/gh/rondevhub","https://www.buymeacoffee.com/RonDev","https://ko-fi.com/U6U31EV2VS","https://www.paypal.com/paypalme/Depressionist1/4,99"],"categories":[],"sub_categories":[],"readme":"# 🤖 MastoHashBot\n\nMastoHashBot is a lightweight automation bot for Mastodon.  \nIt automatically searches for posts (toots) containing specific hashtags and boosts them.  \nThe bot ensures that no post is boosted twice by storing processed IDs in a JSON file and also cleans up old entries after a configurable period of time.\n\n[![Buy me a coffee](https://mini-badges.rondevhub.de/icon/cuptogo/Buy_me_a_Coffee-c1d82f-222/social \"Buy me a coffee\")](https://www.buymeacoffee.com/RonDev)\n[![Buy me a coffee](https://mini-badges.rondevhub.de/icon/cuptogo/ko--fi.com-c1d82f-222/social \"Buy me a coffee\")](https://ko-fi.com/U6U31EV2VS)\n[![Sponsor me](https://mini-badges.rondevhub.de/icon/hearts-red/Sponsor_me/social \"Sponsor me\")](https://github.com/sponsors/RonDevHub)\n[![Pizza Power](https://mini-badges.rondevhub.de/icon/pizzaslice/Buy_me_a_pizza/social \"Pizza Power\")](https://www.paypal.com/paypalme/Depressionist1/4,99)\n---\n\n## ✨ Features\n\n- 🔎 Searches for multiple hashtags across any Mastodon instance  \n- 🚀 Automatically boosts posts (no duplicates)  \n- 🧹 Cleans up old entries from the JSON file after `X` days  \n- 📂 Stores boosted IDs locally in `posted_ids.json`  \n- ⚙️ Configurable via environment variables or script variables  \n\n---\n\n## 📋 Requirements\n\n- PHP **\u003e= 7.4** (for the PHP version of the bot)  \n- cURL extension enabled in PHP  \n- Bash + `curl` + `jq` (for the Bash version of the bot)  \n- A Mastodon **access token** with `write:accounts` and `write:statuses` permissions  \n- A Mastodon **instance URL** (e.g. `mastodon.social`)\n\n---\n\n## ⚙️ Setup\n\n### 1. Get a Mastodon Access Token\n\n1. Log in to your Mastodon instance  \n2. Go to **Preferences \u003e Development \u003e New Application**  \n3. Give it a name, e.g. `MastoHashBot`  \n4. Select required permissions:\n   - `read:statuses`\n   - `write:accounts`\n   - `write:statuses`\n5. Copy the generated **Access Token**\n\n---\n\n### 2. Configure the Bot\n\nEdit the script (PHP or Bash) and set:\n\n```php\n// PHP Version\n$accessToken = 'INSERT_YOUR_ACCESS_TOKEN_HERE';\n$instance = 'YOUR_INSTANCE_HERE';\n$hashtags = ['hashtag1', 'hashtag2'];\n$cleanupDays = 30;\n```\n```bash\n# Bash Version\nACCESS_TOKEN=\"INSERT_YOUR_ACCESS_TOKEN_HERE\"\nINSTANCE=\"YOUR_INSTANCE_HERE\"\nHASHTAGS=\"hashtag1 hashtag2 hashtag3\"\nCLEANUP_DAYS=30\n```\n---\n\n### 3. Run the Bot\n\nPHP Version:\n```\nphp mastohashbot.php\n```\nBash Version:\n```\nbash mastohashbot.sh\n```\nYou should see log messages like:\n```\nStarting Mastodon bot run...\nThere are 0 IDs that have already been boosted.\nSearching for posts with hashtag #fediGive...\nPost ID 123456 boosted successfully!\nBot run completed.\n```\n---\n\n### 🗑 JSON File Cleanup\n\nThe bot stores boosted post IDs in a JSON file (`posted_ids.json`).\nTo prevent the file from growing indefinitely, entries older than `$cleanupDays` are automatically removed.\n\n---\n\n### 🤝 Usage in Production\n\n- Run the bot regularly via cronjob or a systemd timer, for example:\n```\n# Run every 15 minutes\n*/15 * * * * php /path/to/mastohashbot.php \u003e\u003e /path/to/mastohashbot.log 2\u003e\u00261\n```\n- Monitor the logs (`mastohashbot.log`) to check the activity.\n\n---\n\n### 📦 Folder Structure\n```\n.\n├── mastohashbot.php    # PHP version of the bot\n├── mastohashbot.sh     # Bash version of the bot\n├── posted_ids.json     # Stores boosted IDs\n└── README.md           # Project documentation\n```\n\n---\n\n### 🔒 Security Notes\n- Keep your Access Token secret – it allows actions on your Mastodon account.\n- Do not commit your token into version control (e.g. GitHub).\n- Consider using environment variables or `.env` files instead of hardcoding tokens.\n\n---\n\n### 🌐 Example Use Cases\n- 📢 Community hashtags (e.g. `#fediGive`, `#fediHelp`)\n- 🛒 Local marketplaces (e.g. `#flohmarkt`)\n- 🐘 Automated content boosting for niche topics\n\n---\n\n### 🛠 Troubleshooting\n- Error: API request error (401 Unauthorized)\n→ Check your access token and permissions\n- Error: No results found\n→ Make sure the hashtag exists and is used\n- Error: JSON decode error\n→ The Mastodon API returned unexpected data (try again later)\n\n---\n\n### 📜 License\nMIT License – free to use, modify, and distribute.\n\n---\n\n### 👨‍💻 Author\nDeveloped with ❤️ for the Fediverse.\nFeel free to fork, contribute, or open issues!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frondevhub%2Fmastohashbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frondevhub%2Fmastohashbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frondevhub%2Fmastohashbot/lists"}