A Python HTTP/JSON script to display the score of today’s NHL hockey games. When run in persistent mode, information is downloaded directly from the NHL website every 20 seconds.
Requirements
- Python 3.6+
python3 --version
Additional requirements can be installed with pip - there is a requirements.txt
file provided that allows you to simply run pip3 install -r requirements.txt
. Included in this file are the following packages:
Usage
usage: ticker.py [-h] [-p]
optional arguments:
-h, --help show this help message and exit
-p, --persist live-update scores on persistent scoreboard
Once you’ve installed the requirements (pip3 install -r requirements.txt
), permit the script to execute:
chmod u+x ticker.py
Then run the script:
ticker.py
This will run the script once, simply outputting the current scores.
If you wish to run the script persistently and have the scores auto-update every 20 seconds, add the --persist
flag:
ticker.py -p
To quit, press Ctrl + C
Data Source
- NHL livescore JSON (There is a newer API, but I prefer the way this one is laid out for simple scoreboard use)
License
Copyright 2018 Stevie Howard.