Skip to content

dlozeve/oeis_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Mastodon bot posting random OEIS sequences

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages