This is the source for the Laterball football match watchability rating generator running at laterball.com
I like to watch replays of football games on demand, but hate having the score spoiled for me, so I always wanted to know which game is worth spending time watching without knowing the score.
So I built laterball.com ↠
It calculates watchability ratings for the latest EPL and Champions League games, without spoilers!
The Ktor server returns static HTML to the configured routes (one for each supported league and an about page). When a request is received, the server calculates the ratings for all matches within the past 7 days based on match statistics, events and odds. Match data is fetched from API-Football and cached to minimise API requests.
A Twitter bot tweets the ratings for 4- and 5-star games (maximum one per kickoff time, maximum one every 4 hours) to @laterball
(Deprecated) This repository contains a GitHub action for deploying to Google App Engine, provided the appropriate secrets are set in the repository. The required secrets are defined in the application.conf
file. The action runs every time a new tag is pushed to main.
Currently, clicking on the ↠ icon next to a match just Googles where to watch the match streaming on demand. Ideally, this would take the user to the official streaming provider for their local region.
Crowdsourcing ratings could improve rating accuracy, and could be weighted against the statistically-determined ratings
Accounting for:
- xG
- Relative league position/importance of match
- Timing of goals (late winner etc)
Laterball is currently hosted on a single Linode instance. It makes use of an in-memory cache to reduce DB roundtrips, and a Mongo database to persist data between restarts. If the application ever needs to support horizontal scaling, a more robust centralised caching mechanism would be required.