8.3 KiB
π Sports Ticker
Live sports alerts with scoring updates and real-time stats β completely FREE!
Track soccer, football, basketball, hockey, baseball, F1, and more!
Built for Bot but works standalone too.
β¨ Features
- π― Multi-sport support β Soccer, NFL, NBA, NHL, MLB, F1, and more!
- β½ Live scoring alerts with player names and times
- π₯ Key events β cards, touchdowns, home runs, goals
- βΈοΈ Period updates β Halftime, quarters, intermissions
- π Final results with WIN/LOSS/DRAW
- π Multi-team support β track as many teams as you want
- π Auto-scheduling β cron jobs for match days (Bot)
- π° 100% FREE β no API keys, no subscriptions!
π― The Secret Sauce: ESPN API
This skill uses ESPN's public API which provides:
- Real-time scores across multiple sports
- Scoring plays with player names and timestamps
- Game events (touchdowns, goals, home runs, etc.)
- Match/game statistics
No API key required! ESPN's API is open and free to use.
Supported Sports & Leagues
β½ Soccer/Football
- Premier League (
eng.1), La Liga (esp.1), Bundesliga (ger.1), Serie A (ita.1) - Champions League (
uefa.champions), Europa League (uefa.europa) - MLS (
usa.1), Liga MX (mex.1), and 20+ more
π American Football
- NFL (
nfl)
π Basketball
- NBA (
nba), WNBA (wnba), NCAA (mens-college-basketball)
π Hockey
- NHL (
nhl)
βΎ Baseball
- MLB (
mlb)
ποΈ Racing
- Formula 1 (
f1)
π Quick Start
1. Install
# Clone or copy to your skills directory
skills install sports-ticker
# Or manually
git clone https://github.com/your-repo/sports-ticker
cd sports-ticker
2. Configure Your Teams
# Interactive setup
python3 scripts/setup.py
# Or find team IDs directly
python3 scripts/setup.py find "Lakers" basketball
python3 scripts/setup.py find "Chiefs" football
python3 scripts/setup.py find "Barcelona" soccer
Common team IDs for reference:
Soccer:
- Tottenham: 367, Arsenal: 359, Liverpool: 364, Man City: 382, Man United: 360
- Barcelona: 83, Real Madrid: 86, Bayern: 132, PSG: 160, Juventus: 111
American Sports:
- Lakers: 13, Warriors: 9, Celtics: 2 (NBA)
- Chiefs: 12, 49ers: 25, Cowboys: 6 (NFL)
- Maple Leafs: 10, Oilers: 22, Rangers: 4 (NHL)
- Yankees: 10, Dodgers: 19, Red Sox: 2 (MLB)
3. Create config.json
cp config.example.json config.json
Edit config.json:
{
"teams": [
{
"name": "Liverpool",
"short_name": "Liverpool",
"emoji": "π΄",
"sport": "soccer",
"espn_id": "364",
"espn_leagues": ["eng.1", "uefa.champions"],
"enabled": true
},
{
"name": "Los Angeles Lakers",
"short_name": "Lakers",
"emoji": "πππ",
"sport": "basketball",
"espn_id": "13",
"espn_leagues": ["nba"],
"enabled": true
},
{
"name": "Kansas City Chiefs",
"short_name": "Chiefs",
"emoji": "π",
"sport": "football",
"espn_id": "12",
"espn_leagues": ["nfl"],
"enabled": true
}
],
"alerts": {
"goals": true,
"red_cards": true,
"halftime": true,
"fulltime": true,
"kickoff": true
}
}
4. Test It
# Show ticker for your teams
python3 scripts/ticker.py
# Check live matches
python3 scripts/live_monitor.py --verbose
# View a specific league
python3 scripts/ticker.py league eng.1 soccer
python3 scripts/ticker.py league nfl football
python3 scripts/ticker.py league nba basketball
# ESPN API commands
python3 scripts/espn.py leagues # List all sports/leagues
python3 scripts/espn.py leagues soccer # List soccer leagues
python3 scripts/espn.py scoreboard nba basketball
python3 scripts/espn.py search "Lakers" basketball
π± Example Alerts
β½ Soccer Goal:
π GOAL! 23'
β½ Marcus Rashford (Manchester United)
Manchester United 1-0 Liverpool
π NFL Touchdown:
π TOUCHDOWN! Q2 3:42
π Patrick Mahomes (Kansas City Chiefs)
Chiefs 14-7 Bills
π NBA 3-Pointer:
π 3-POINTER! Q3 8:15
π― LeBron James (Los Angeles Lakers)
Lakers 78-72 Warriors
π NHL Goal:
π GOAL! P2 12:34
π Connor McDavid (Edmonton Oilers)
Oilers 3-2 Maple Leafs
Final Score:
π FINAL - WIN! πβ
π
Kansas City Chiefs 31-24 Buffalo Bills
π€ Bot Integration
Automatic Cron Setup
The easiest way to set up match-day alerts is with the setup script:
# Run the setup script with your Telegram ID and timezone
python3 scripts/setup_crons.py <telegram_id> <timezone>
# Example
python3 scripts/setup_crons.py 123456789 "Europe/London"
python3 scripts/setup_crons.py 123456789 "America/New_York"
# Just view the cron configs without creating
python3 scripts/setup_crons.py --list
This creates 3 cron jobs:
| Cron Job | Schedule | Purpose |
|---|---|---|
football-match-check |
Daily 9 AM | Checks if your teams play today |
spurs-live-ticker |
Every 2 mins (disabled) | Live updates during matches |
spurs-reminder |
Dynamic (disabled) | 30-min pre-match reminder |
How Auto-Scheduling Works
- Morning check β
football-match-checkruns at 9 AM daily - Match found? β If any team plays today, it:
- Updates
spurs-live-tickerto start 5 mins before kickoff - Sets
spurs-reminderfor 30 mins before kickoff - Enables both crons
- Updates
- During match β
spurs-live-tickerruns every 2 mins, sending goals/cards/events - No match? β Both crons stay disabled (no spam!)
Manual Cron Setup
If you prefer manual setup, here are the cron expressions:
# Daily match check at 9 AM
0 9 * * * # football-match-check
# Live ticker every 2 minutes (enable only during matches)
*/2 * * * * # spurs-live-ticker
# Pre-match reminder (set to 30 mins before kickoff)
30 14 * * * # spurs-reminder (example: 2:30 PM for 3 PM kickoff)
Cron Payload Examples
Match Check (daily):
{
"message": "Check if any configured teams play today. If a match is found, update spurs-live-ticker to start 5 mins before kickoff and run for 3 hours. Enable spurs-reminder for 30 mins before kickoff."
}
Live Ticker (during matches):
{
"message": "Run python3 scripts/live_monitor.py and send any new events (goals, cards, halftime, fulltime). Only message if there are updates."
}
Live Monitor Script
During matches, run every 2 minutes:
python3 scripts/live_monitor.py
The script only outputs when there are new events (goals, cards, etc.), making it perfect for cron-based alerting.
π§ Scripts Reference
| Script | Purpose |
|---|---|
ticker.py |
Show current status of your teams |
live_monitor.py |
Check for live updates (for cron) |
espn.py |
Direct ESPN API access |
setup.py |
Interactive setup wizard |
config.py |
Configuration management |
π ESPN API Reference
Base URL: https://site.api.espn.com/apis/site/v2/sports
Endpoints
# Scoreboard (all today's games)
/{sport}/{league}/scoreboard
# Game details with events
/{sport}/{league}/summary?event={event_id}
# Team info
/{sport}/{league}/teams/{team_id}
Sport & League Codes
Soccer: soccer/eng.1, soccer/esp.1, soccer/uefa.champions
Football: football/nfl
Basketball: basketball/nba, basketball/wnba
Hockey: hockey/nhl
Baseball: baseball/mlb
Racing: racing/f1
π License
MIT β use it however you want!
π ESPN API Resources
- Public ESPN API Documentation β comprehensive endpoint list
- ESPN OpenAPI Spec β formal OpenAPI/Swagger schema
- Interactive API Explorer β try endpoints in browser
- Zuplo Guide β overview & alternatives
β οΈ Note: ESPN's API is unofficial/undocumented. It's stable and widely used, but could change without notice. The skill handles errors gracefully.
π Credits
- ESPN for their awesome (and free!) API
- pseudo-r, zuplo, and the community for API documentation
- Built with β€οΈ for football fans everywhere
Happy tracking! β½π