Update your Slack status with a baseball score.
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.editorconfig
.env.example
.gitignore
.travis.yml
LICENSE
README.md
index.js
package-lock.json
package.json
screenshot.png

README.md

mlb-slack-status

Sync you Slack status with an MLB team.

Build Status Greenkeeper badge js-standard-style

go cubs

Usage

git clone git@github.com:lukekarrys/mlb-slack-status.git
cd mlb-slack-status
npm install
cp .env.example .env
  1. Acquire a Slack token. You could setup a Slack app with a users.profile:write scope (takes some work) or use a legacy token (not so much work)
  2. Edit .env with your TOKEN and other variables (like TEAM)
  3. Bonus: upload your team's logo as an emoji in Slack and set it as EMOJI in .env
  4. npm run deploy && npm run clean (the clean part will remove any old deploys)

What it does

You should now have a server that updates your Slack status to your team's current result. That result will be one of the following:

  • Scheduled: CHC – 8:05 EDT vs PIT

    If a game is scheduled for that day it will set your status to the time of the game. The server will then sleep until the start of the game before attempting to update your status again.

  • In progress: CHC – 1-0 Top 4th 1 out vs PIT

    If a game is in progress it will set your status to the current result of the game. It will check on a set interval until the game is complete.

  • Completed: CHC – L 1-6 F/11 vs PIT

    Once the game is completed it will set your status the the final result of the game. The server will then sleep until the next day before trying to find the next game.

  • Off day: CHC – No game today

    If there is no game scheduled, it will set your status as described. The server will then sleep until the next day before trying to find the next game.

LICENSE

MIT