Skip to main content

Project Info & Documentation

Everything about how Whatchan Snooker was built, what auto-updates, and how to manage it.

Site: Live GitHub Actions: Active Repo: Private Rankings: Manual update required after events
๐Ÿ“„
Total Pages
50
HTML files including 24 player profiles
๐Ÿค–
Auto-Updates
2
GitHub Actions workflows running on schedule
๐Ÿ“Š
Data Files
3
news.json ยท rankings.json ยท tv-schedule.json
๐ŸŽฌ
Video Embeds
70+
Click-to-load thumbnails, zero broken iframes
GitHub Repository
โš™๏ธ
Dj4beat / snooker-hub
Whatchan Snooker โ€” player profiles, TV schedule, rankings, and comprehensive snooker coverage. Sister site to whatchan.co.uk.
๐Ÿ”’ Private ๐ŸŒฟ Branch: master ๐Ÿ“ 61 files โšก 2 workflows
View on GitHub โ†—
Sibling repos: boxing-hub ยท darts-hub ยท whatchan-daily
Auto-Update Schedule
Daily ยท 06:00 UTC
News feed updated
Fetches Google News RSS for "snooker world snooker" โ†’ writes data/snooker-news.json โ†’ commits only if changed โ†’ page loads JS to display latest articles in #news-grid
Monday ยท 07:00 UTC
Rankings timestamp updated
Stamps updated field in data/rankings.json. Rankings data itself is seeded manually โ€” edit the JSON after each ranking event.
Manual (as needed)
TV schedule updated
Edit data/tv-schedule.json directly when tournament status changes (upcoming โ†’ completed) or new events are added. Changes go live on next page load.
Trigger workflows manually: Go to github.com/Dj4beat/snooker-hub/actions โ†’ select workflow โ†’ "Run workflow" to force an immediate run. Useful after first deploy or when you want fresh news immediately.
Dynamic Update Hook Points

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
How to Update Rankings Manually

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.

File Structure
Snooker/
โ”œโ”€โ”€ 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
Video Embeds โ€” How They Work
Boxing lesson learned: Auto-selecting YouTube videos from any channel causes broken embeds โ€” many uploaders disable embedding on their videos, producing blank black boxes that can't be fixed without touching the HTML.
Fix used throughout this site: Click-to-load thumbnail pattern. The <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.
Lessons Learned & Pain Points

Critical issues encountered during the build. Read before starting any new sport microsite.

1. AI Agents Fabricate YouTube Video IDs: All 60 video IDs generated by AI agents were fake (100% failure rate). Every ID must be verified via the YouTube oEmbed API (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.
2. GitHub Push Rejected: After initial push, GitHub Actions auto-ran and created commits on the remote. Next local push was rejected. Fix: git pull --rebase origin master && git push. Always check git status before pushing.
3. Workflow Paths Wrong: Workflows had 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.
4. Git Author Not Set: First git commit failed. Run git config user.name "Dj4beat" and git config user.email "bot@whatchan.co.uk" before first commit.
5. Homepage Links Wrong: All player cards linked to players.html (hub) instead of individual profiles. Manually test every link after building the homepage.
6. Countdown Showing "Loading...": JS in app.js fires on DOMContentLoaded (end of page). Above-the-fold dynamic content needs inline <script> immediately after its HTML, not deferred external JS.
7. Duplicate Nav Links: Bulk nav-update script added links that already existed in a different format. Check for existing content before inserting.
8. python3 Not Found on Windows: Use python not python3 on Windows.
9. Background Agent Permission Denials: Spawned agents can be denied tool access. Use Chrome browser MCP for YouTube research. For large multi-file transforms, build a Node.js script from template pages rather than having agents edit files individually.
10. Factual Errors: The 147s page incorrectly stated 147 was "the highest possible score". Free ball rule allows up to 155; O'Sullivan scored 153 at the 2026 World Open. Always cross-reference key facts against official sources.
Key takeaway: Never trust AI-generated YouTube IDs, file paths, or sport-specific facts without independent verification. The playbook's checklist now includes verification steps for all of these.
Playbook for Other Sports

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.