5 Commits

Author SHA1 Message Date
c8a5e47de1 Update docker-deploy.yml 2024-02-18 13:52:52 -05:00
ea4c6dc24e Merge pull request #9 from JoshNotWright/hotfix/tweak-game-score
Update app.py: change game score calculation
2024-02-18 13:40:12 -05:00
95494cab89 app.py: change game score calculation 2024-02-18 13:39:45 -05:00
2859d6cf6b Create docker-deploy.yml 2024-02-18 13:37:11 -05:00
5d8f975820 README.md: add readme 2024-02-18 13:27:38 -05:00
3 changed files with 77 additions and 1 deletions

23
.github/workflows/docker-deploy.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Docker Build and Push
on:
release:
types: [published]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: mr-smithers-excellent/docker-build-push@v6.3
name: Build & push Docker image
with:
image: joshnotwright/nhlscoreboard
tags: ${{ github.event.release.tag_name }}, latest
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

53
README.md Normal file
View File

@@ -0,0 +1,53 @@
# NHL Scoreboard Web App
This web application displays live NHL game scores, team statistics, and game states in real-time. It retrieves data from the NHL API and presents it in a user-friendly interface.
## Features
- Displays live NHL game scores.
- Sorts games based on priority to highlight the most exciting matchups.
- Responsive design for desktop and mobile devices.
## Technologies Used
- **Python**: Backend scripting language.
- **Flask**: Web framework for Python.
- **HTML/CSS**: Frontend markup and styling.
- **JavaScript**: Client-side scripting for auto-refresh functionality.
## Installation
1. Clone the repository:
```bash
git clone https://github.com/your-username/nhl-scoreboard.git
```
2. Install dependencies:
```bash
pip install -r requirements.txt
```
3. Run the application:
```bash
python app.py
```
4. Open your web browser and navigate to `http://localhost:2897` to view the scoreboard.
## Usage
- The scoreboard will display live NHL game scores, team statistics, and game states.
- Games are sorted based on priority to highlight the most exciting matchups.
- The page updates automatically every 10 seconds to show the latest data.
- Responsive design ensures a seamless experience on desktop and mobile devices.
## Credits
Special thanks to the NHL for providing the data through their API.
## License
This project is licensed under the [MIT License](LICENSE).

2
app.py
View File

@@ -180,7 +180,7 @@ def calculate_game_priority(game):
home_score = game["homeTeam"]["score"]
away_score = game["awayTeam"]["score"]
score_difference = abs(home_score - away_score)
score_total = (home_score + away_score) * 15
score_total = (home_score + away_score) * 20
if period == 4:
base_priority = 400