All projects

OnRadioNow

A searchable archive of every song played on BBC Radio 1, 2, 1Xtra and 6 Music since 2006, collected via Last.fm.

Year
2009
Status
Live
Stack
  • PHP
  • MySQL
  • htmx
  • Tailwind CSS
Links
The OnRadioNow homepage, with a search box, the song playing now on each of the four stations, and totals for the archive.

What it is

OnRadioNow is a searchable archive of every song aired on BBC Radio 1, Radio 2, 1Xtra and 6 Music since April 2006. It started in 2009 as Radio 1 Now. In 2026 I rebuilt it in PHP 8.3, MySQL, htmx and Tailwind 4, and kept the original 2009 code alongside it for reference.

Why I built it

I originally built this site purely for my own use. Back in 2009 as a teenager I wanted to know what songs were playing on the radio – and once I’d managed that, I found that capturing the song data and storing it in a database was a fun, useful and rewarding problem to keep tackling.

Technical notes

  • Every 15 minutes a cron job ingests new plays from Last.fm scrobbles into a single plays table, deduplicated with INSERT IGNORE and searchable through a full-text index.
  • Page requests never run heavy aggregates: rollups and a JSON stats cache are computed ahead of time.
  • A separate, resumable worker enriches tracks from MusicBrainz at about one request a second. Artist images and bios come from Wikipedia.
  • htmx is vendored with an integrity check, the site sends strict security headers and a content security policy, and the deploy script refuses to finish if the legacy code is reachable.
  • The backfill is idempotent and resumable, and backs off exponentially when Last.fm rate-limits it.
  • The 2009 code stays in the repo for contrast: mysql_* calls, a latin1 MyISAM table per station, and cron triggered from the web.