How to win $1000

I’ve mentioned in the past that I listen to The Rock when working, as it’s possible to pick up their Auckland broadcast online here. I can’t pick them up locally as there is no reception. I always found it curious how they have a ticker on their page that shows the currently playing song. Also curious is that it would quite frequently be out of sync with the song I was listening to. Clearly the music was being streamed and cached on my computer.

The Rock has a ‘no repeat workday’ where they’ll give $1000 to the first person who rings up to tell them of a repeated song. This week they are doing a guaranteed repeat each day.

I wondered if the website was exposing any additional data that could either tell me the schedule of songs (highly unlikely) or at least give me the currently playing song, to get me on a level playing field with the rest of the radio-listening population.

What I ended up doing was writing a very short Java program (yes, it could probably be written in one line of Ruby or Perl but I’m a Java programmer). It isn’t supposed to actually be used, but it does work as expected – it tells me the currently playing song, and warns me when a song is repeated. I don’t recommend you actually use it (I certainly won’t be), but it’s there for your personal education.

The code is as follows (I recommend you click the ‘view plain’ link if you see the formatted Java code):