Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c8a5e47de1 | |||
| ea4c6dc24e | |||
| 95494cab89 | |||
| 2859d6cf6b | |||
| 5d8f975820 |
23
.github/workflows/docker-deploy.yml
vendored
Normal file
23
.github/workflows/docker-deploy.yml
vendored
Normal 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
53
README.md
Normal 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
2
app.py
@@ -180,7 +180,7 @@ def calculate_game_priority(game):
|
|||||||
home_score = game["homeTeam"]["score"]
|
home_score = game["homeTeam"]["score"]
|
||||||
away_score = game["awayTeam"]["score"]
|
away_score = game["awayTeam"]["score"]
|
||||||
score_difference = abs(home_score - away_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:
|
if period == 4:
|
||||||
base_priority = 400
|
base_priority = 400
|
||||||
|
|||||||
Reference in New Issue
Block a user