A simple service I wrote to keep track of the ELO rating of foosball players at work, but it can be used to create a league for any type of game. It has a web api and a slack bot interface.
ELO is a system used mostly in chess and video games to rate the skill level of players. Read more about ELO rating here: https://en.wikipedia.org/wiki/Elo_rating_system
Install dependencies with npm install then start the server with npm start.
- Generate graphs and expose them through http and slack
- Introduce seasons
You can interact with the service through slack if you specify your slack API token and channel in config.json. You can also specify them in the environment variables SLACK_API_TOKEN and SLACK_API_CHANNEL (the channel name needs to be without the # in front).
In Development environment you can set your variables by command line as you can see in the below lines:
Unix: export SLACK_API_CHANNEL=your-channel-name Windows: setx SLACK_API_CHANNEL
The bot will list available commands if you write !help in the channel.
Returns the entire list of players sorted by ELO rating
Creates a new player starting at ELO 1000.
Request body:
{
"name": <new players name>
}
Calculates and updates the Elo rating of the winner and loser of a game
Request body:
{
"winner": <winner name>,
"loser": <loser name>
}
Calculates and updates the Elo rating of the winners and losers of a N vs N game. The number of winners and losers must be the same for this calculation to work.
Request body:
{
"winners": [
<winner 1 name>,
<winner 2 name>,
],
"losers": [
<loser 1 name>,
<loser 2 name>,
]
}
This software can be used under the ISC license