Posts the latest playoff odds for NHL teams to Mastodon.
- NodeJS >= 16
- Redis server
- Mastodon API Key
May also have additional requirements for canvas
, depending on the operating system.
These values must be set in the running process's environment. You can use a tool like dotenv
or the newer dotenvx
.
Environment Variable | Required? | Description | Example |
---|---|---|---|
TEAM_CODE |
No1 | Abbreviation of team (as shown on MoneyPuck) | NSH |
REDIS_URL |
Yes | URL of a Redis server | redis://localhost:6379 |
MASTODON_BASE_URL |
Yes | Base URL of the Mastodon server | https://mastodon.social |
MASTODON_TOKEN |
Yes | API token for your bot | someratherlong_apitoken123 |
The bot is designed to be run on a regular schedule (likely no more than hourly) via cron
or similar service.
0 * * * * cd your/path && dotenv --file .env.development run -- npm start
Runs the application
Produces more verbose output for debugging.
Resets the Redis cache, may result in a duplicate post.
Runs the test suite.
Footnotes
-
If set, it will skip the league-wide post. If not set or empty, it will generate posts for all teams with greater than a 0.01% chance. โฉ