We realized that there is no application that reports NBA results of the day on Slack during one of our meaningless conversations about sports. Since it was the long weekend, I started to look for potential resources I can utilize to bring the scores to our slack channel.
Reading Matt Makai’s post about how to build a slack bot with python, I was able to initialize the first version of the bot following the steps explained here:
The next step was to find a way to reliable get live scores. First, I gave nba_api (super cool) a try.
However, it looks like scoreboard and scoreboardv2 endpoints are not actually reporting real-time scores, instead, they are updated at intervals. Therefore, it is kind of pointless to use these endpoints. I quickly realized what I need is much more simple so I decided to code it myself. Quick internet search and reading some posts on Reddit lead me to this
It lists all the available API endpoints that anyone can send requests to. No key is needed which is perfect for my simple bot. Swar’s python library (nba_api) uses stats.nba.com that is a little different than data.nba.net
Data.nba.net reports real-time scores as well as historical ones. Scores are updated real time and it is even faster than what you see on Google when you search for NBA scores.
I created the bot with 3 main functionalities. These functionalities are emerged from our need to know the score of the game and player stats after the game. All of these functionalities are explained on the Github page. Here is the link for interested developers:
Slack application for live NBA scores. Contribute to ak4728/slack-nbascore-app development by creating an account on…
The first two functionalities are to get the scores and games of the day. You can either use (@ nbascore nba) to get all the games or…