Project Info & Documentation
Everything about how Whatchan Snooker was built, what auto-updates, and how to manage it.
data/snooker-news.json โ commits only if changed โ page loads JS to display latest articles in #news-gridupdated field in data/rankings.json. Rankings data itself is seeded manually โ edit the JSON after each ranking event.data/tv-schedule.json directly when tournament status changes (upcoming โ completed) or new events are added. Changes go live on next page load.These IDs and classes in the HTML are where js/app.js injects live data from the JSON files.
| Hook | Page(s) | What it does |
|---|---|---|
| id="news-grid" | index.html | Renders latest 6 news articles from snooker-news.json as article cards |
| id="tv-schedule-body" | index.html, tv-schedule.html | Fills <tbody> rows from tv-schedule.json with broadcaster badges and status badges |
| id="rankings-table-body" | rankings.html | Fills <tbody> rows from rankings.json with movement arrows and prize money |
| class="rankings-updated" | rankings.html, player pages | Injects "Rankings updated: DD Month YYYY" text from rankings.json updated field |
| class="tv-schedule-updated" | tv-schedule.html | Injects "Last updated: DD Month YYYY" from tv-schedule.json updated field |
| data-player-rank="Name" | All 24 player profile pages | Injects "#N" current world ranking โ name must exactly match rankings.json player field |
After a major ranking event, update the JSON file directly โ the site will reflect changes immediately on next page load.
1. Edit data/rankings.json
Move players up/down, update their rank values, set old rank in prev_rank, update prize_money. Update the updated timestamp at the top.
2. Commit and push
GitHub will detect the change and the updated JSON becomes live immediately (static file serving โ no build step needed).
3. Rankings table and all player pages update automatically
The JS overlay reads the JSON on every page load โ rankings.html table, all data-player-rank spans on player profiles, movement arrows and prize money all update without touching any HTML.
โโโ index.html โ Homepage ยท #news-grid ยท #tv-schedule-body
โโโ css/
โ โโโ style.css โ Full design system ยท --red: #16a34a (snooker green)
โโโ js/
โ โโโ app.js โ Loaders: news ยท rankings ยท TV schedule ยท video embeds
โโโ data/
โ โโโ snooker-news.json โ Updated daily by GitHub Actions
โ โโโ rankings.json โ Updated manually after events
โ โโโ tv-schedule.json โ Updated manually as schedule changes
โ โโโ README.md โ Hook points docs
โโโ scripts/
โ โโโ update-snooker-news.py โ Google News RSS โ snooker-news.json
โ โโโ update-rankings.py โ Stamps rankings.json updated timestamp
โโโ .github/workflows/
โ โโโ daily-update.yml โ 06:00 UTC daily ยท news update
โ โโโ weekly-update.yml โ 07:00 UTC Monday ยท rankings timestamp
โโโ pages/
โโโ tv-schedule.html โ PRIMARY SEO PAGE ยท #tv-schedule-body ยท FAQPage schema
โโโ rankings.html โ #rankings-table-body ยท .rankings-updated
โโโ players.html โ Player hub grid
โโโ player-judd-trump.html โ data-player-rank="Judd Trump"
โโโ player-ronnie-osullivan.html โ ... (ร24 total)
โโโ goat.html โ Greatest of All Time ยท filter/search JS
โโโ best-british.html โ Nation tabs ยท England ยท Scotland ยท Wales ยท NI
โโโ tournaments.html โ Tournament calendar
โโโ world-championship.html โ Individual tournament pages ร6
โโโ guides.html โ Guides hub
โโโ guide-rules.html โ Rules ยท formats ยท scoring ยท betting ร4
โโโ glossary.html
โโโ centuries.html
โโโ maximum-breaks.html โ 147s page
โโโ break-builder.html โ Interactive tool
โโโ average-calculator.html
โโโ about.html ยท contact.html ยท privacy.html
โโโ project-info.html โ This page ยท noindex
<img> thumbnail loads from img.youtube.com/vi/{ID}/hqdefault.jpg โ this CDN always works regardless of embed settings. The iframe only loads when the user clicks play. A "Watch on YouTube โ" fallback link is always visible. Only WST official channel video IDs are used.
Critical issues encountered during the build. Read before starting any new sport microsite.
https://www.youtube.com/oembed?url=...&format=json) โ HTTP 200 = valid, anything else = broken. Use the Chrome browser tool to search YouTube directly and extract real IDs from the DOM.
git pull --rebase origin master && git push. Always check git status before pushing.
cd Snooker and git add Snooker/data/... โ but the GitHub repo root IS the sport folder. All paths must be relative to repo root, not local filesystem.
git commit failed. Run git config user.name "Dj4beat" and git config user.email "bot@whatchan.co.uk" before first commit.
players.html (hub) instead of individual profiles. Manually test every link after building the homepage.
app.js fires on DOMContentLoaded (end of page). Above-the-fold dynamic content needs inline <script> immediately after its HTML, not deferred external JS.
python3 Not Found on Windows: Use python not python3 on Windows.
A full reusable playbook covering the entire build process is saved at:
C:\Users\Dj4be\Desktop\Whatchan2.0\SPORTS-MICROSITE-PLAYBOOK.md
Covers: folder structure ยท CSS recolouring ยท auto-update architecture ยท Python scripts ยท GitHub Actions ยท video embed pattern ยท player profile template ยท SEO strategy ยท bulk nav update script ยท full new-sport checklist.