➡️ @OEISbot@mathstodon.xyz ⬅️
Fetch a random sequence from the OEIS, and post it to Mastodon.
A random sequence ID is picked in the range 1-380,000. Sequences that
are probably uninteresting are ignored. Currently this includes
sequences tagged with one of the keywords dead, dumb, dupe,
less, obsc, probation, and uned. See the
documentation for details.
The sequence is then retrieved in the JSON format.
MASTODON_INSTANCE_URL: URL of the Mastodon instance.MASTODON_ACCESS_TOKEN: access token of the account on the Mastodon instance. It can be generated in Preferences > Development > New application. The token only needs thewrite:statusespermission.
- Build with
cargo build --release. - Copy the executable to the server:
scp target/release/oeis_bot my-server:~/.local/bin - Copy the systemd service and timer configuration to the server:
scp oeis-bot.{service,timer} my-server:~/.config/systemd/user - Edit
oeis-bot.servicewith the correct value for the environment variables. - Activate the timer:
systemctl --user daemon-reload systemctl --user start oeis-bot.timer