https://github.com/mrrfv/mastodon-scheduled-toot
Mastodon bot that posts according to a cron-like schedule
https://github.com/mrrfv/mastodon-scheduled-toot
cron javascript mastodon mastodon-api mastodon-bot mastodon-scheduled-toot nodejs schedule
Last synced: 3 months ago
JSON representation
Mastodon bot that posts according to a cron-like schedule
- Host: GitHub
- URL: https://github.com/mrrfv/mastodon-scheduled-toot
- Owner: mrrfv
- License: bsd-3-clause
- Created: 2023-07-09T12:38:13.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2026-04-15T13:57:59.000Z (3 months ago)
- Last Synced: 2026-04-15T15:38:13.382Z (3 months ago)
- Topics: cron, javascript, mastodon, mastodon-api, mastodon-bot, mastodon-scheduled-toot, nodejs, schedule
- Language: JavaScript
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mastodon Scheduled Post Bot
This is a Node.js application that uses the Mastodon API to post a toot at a specified time.
## Usage
1. Run `npm install` to install dependencies.
2. Go to your Mastodon instance preferences and click Development. Create a new application and copy the access token.
3. Copy `.env.example` to `.env` and fill in the values.
4. Run `node index.js`.
## Docker
You can also run this bot in a Docker container. To do so, follow step 2 from the usage guide and from use the following command:
```bash
docker run -d \
-e TZ="Europe/Berlin" \
-e CRON_SCHEDULE="0 17 * * *" \
-e MASTODON_INSTANCE_URL="your mastodon instance url, for example https://mastodon.social" \
-e MASTODON_USER_TOKEN="your mastodon access token" \
-e MASTODON_STATUS_TEXT="your toot text" \
# takes priority over MASTODON_STATUS_TEXT
# -e MASTODON_STATUS_TEXTS_RANDOM="[\"your toot text 1\", \"your toot text 2\"]" \
-e MASTODON_STATUS_VISIBILITY="unlisted" \
--restart always \
--name mastobot \
mrrfv/mastodon-scheduled-toot:latest
```
Change the value of the `TZ` environment variable for scheduling to work properly.
## License
BSD 3-Clause License. See `LICENSE` for more information.