This is a Python script that tracks and provides live updates for Buffalo Sabres NHL hockey games. It uses the NHL API to fetch game information and updates, allowing you to keep track of Sabres games and hear their goal songs when they score.
Before running this script, make sure you have the following dependencies installed:
- Python 3.x
You can install the required libraries using the requirements.txt
file provided:
pip install -r requirements.txt
- Clone this repository or download the
sabresGoalCheck.py
file.
2a. Manually run the script using the following command to start the goal tracker by itself, no GUI:
python sabresGoalCheck.py
There are now optional flags for starting a flet GUI, (-g and -w).
-g (gui, default False) controls if the GUI is created. -g True creates a GUI element.
-w (webApp, default False) controls if the GUI is a webApp. Eventually this project will transition to a webApp permanently, for now setting this flag to True will give a sneak peak to the webApp.
Examples for starting a local GUI:
python sabresGoalCheck.py -g True -w False
or
python sabresGoalCheck.py -g True
2b. Automatically run the script (if it is in your documents folder) by running "SabreLamp.command." This command just plays goal sounds.
The script works by:
-
Checking if there is a Buffalo Sabres game on the current day by using the NHL API.
-
If a game is found, it retrieves the game information, opponent details, and game start time.
-
It then waits for the game to start and provides information about the game, including the opponent and start time.
-
During the game, it continuously checks for score updates and plays the appropriate goal song when the Sabres score a goal.
-
It provides live score updates throughout the game until it's over.
-
After the game is finished, it waits until the next day to check for new games.
-
The script assumes that the user is in the Eastern Time Zone (ET) and calculates game start times accordingly. It may need adjustments for other time zones.
-
Ensure that your audio files (goal songs) are in the correct format and their paths are correctly specified in the
SabresGoalSongs.json
file. -
The
audioFiles
folder should be included when you clone the GitHub repository. -
This script provides basic functionality and can be expanded upon for further customization or integration into other applications.
This script is provided under the MIT License. See the LICENSE file for more details.
Feel free to contribute to this project or customize it to meet your specific needs.