Spaces:
Running
Running
Add debug endpoint + import debug_fixtures from wc2026_scraper"
Browse files- wc_routes_patch.py +28 -0
wc_routes_patch.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from wc2026_scraper import (
|
| 2 |
+
scrape_summary, scrape_fixtures, scrape_standings, scrape_stats,
|
| 3 |
+
scrape_wc_news, scrape_road_to_wc, get_wc2026_all,
|
| 4 |
+
scrape_history, scrape_h2h, scrape_lineups, scrape_match_detail,
|
| 5 |
+
debug_fixtures
|
| 6 |
+
)
|
| 7 |
+
@app.get('/api/wc2026')
|
| 8 |
+
def api_wc2026_all():return JSONResponse(get_wc2026_all())
|
| 9 |
+
@app.get('/api/wc2026/fixtures')
|
| 10 |
+
def api_wc2026_fixtures():return JSONResponse(scrape_fixtures())
|
| 11 |
+
@app.get('/api/wc2026/standings')
|
| 12 |
+
def api_wc2026_standings():return JSONResponse(scrape_standings())
|
| 13 |
+
@app.get('/api/wc2026/stats')
|
| 14 |
+
def api_wc2026_stats():return JSONResponse(scrape_stats())
|
| 15 |
+
@app.get('/api/wc2026/history')
|
| 16 |
+
def api_wc2026_history():return JSONResponse(scrape_history())
|
| 17 |
+
@app.get('/api/wc2026/news')
|
| 18 |
+
def api_wc2026_news():return JSONResponse(scrape_wc_news())
|
| 19 |
+
@app.get('/api/wc2026/road')
|
| 20 |
+
def api_wc2026_road():return JSONResponse(scrape_road_to_wc())
|
| 21 |
+
@app.get('/api/wc2026/h2h/{event_id}')
|
| 22 |
+
def api_wc2026_h2h(event_id:int):return JSONResponse(scrape_h2h(event_id))
|
| 23 |
+
@app.get('/api/wc2026/lineups/{event_id}')
|
| 24 |
+
def api_wc2026_lineups(event_id:int):return JSONResponse(scrape_lineups(event_id))
|
| 25 |
+
@app.get('/api/wc2026/match/{event_id}')
|
| 26 |
+
def api_wc2026_match(event_id:int):return JSONResponse(scrape_match_detail(event_id))
|
| 27 |
+
@app.get('/api/wc2026/debug')
|
| 28 |
+
def api_wc2026_debug():return JSONResponse(debug_fixtures())
|