This is a Node.js application that uses the Mastodon API to post a toot at a specified time.
- Run
npm install
to install dependencies. - Go to your Mastodon instance preferences and click Development. Create a new application and copy the access token.
- Copy
.env.example
to.env
and fill in the values. - Run
node index.js
.
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:
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.
BSD 3-Clause License. See LICENSE
for more information.