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.