Mastodon bot posting random OEIS sequences https://mathstodon.xyz/@OEISbot
Find a file
2026-02-14 19:22:25 +01:00
src Add systemd service and timer config 2026-02-13 13:38:56 +01:00
.gitignore Initial commit: OEIS sequence types 2026-02-12 21:54:28 +01:00
Cargo.lock Use the json feature of ureq to simplify parsing 2026-02-13 08:42:53 +01:00
Cargo.toml Use the json feature of ureq to simplify parsing 2026-02-13 08:42:53 +01:00
LICENSE Add a license 2026-02-13 17:35:39 +01:00
oeis-bot.service Add systemd service and timer config 2026-02-13 13:38:56 +01:00
oeis-bot.timer Add systemd service and timer config 2026-02-13 13:38:56 +01:00
README.md Add link to the account 2026-02-14 19:22:25 +01:00

OEIS bot

➡️ @OEISbot@mathstodon.xyz ⬅️

Fetch a random sequence from the OEIS, and post it to Mastodon.

Random sequence selection

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 configuration

  • 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 the write:statuses permission.

Deployment

  1. Build with cargo build --release.
  2. Copy the executable to the server:
    scp target/release/oeis_bot my-server:~/.local/bin
    
  3. Copy the systemd service and timer configuration to the server:
    scp oeis-bot.{service,timer} my-server:~/.config/systemd/user
    
  4. Edit oeis-bot.service with the correct value for the environment variables.
  5. Activate the timer:
    systemctl --user daemon-reload
    systemctl --user start oeis-bot.timer