Wednesday, February 3, 2010

Twitter, Code and The TripleJ Hottest 100 of 2010

Australia Day was last week and that means the Triple J Hottest 100. Not being in Australia at the moment I was hoping to listen to the Internet stream but after some initial success ran into some problems. I suspect that the unprecedented interest in the voting for the hottest 100 translated into unprecedented traffic.

This was an emergency, how could I celebrate Australia Day with out the hottest 100?

Clearly, this called for some hackery. Time was running out, we were already 10 songs in.

I noticed that the list was being tweeted via @triplej and I remembered that youtube has everything. Inspiration! I picked up some code I had lying around — my various twitter projects and some code from a friend that would pipe youtube audio tracks into mplayer — and started copy, pasting and hacking. Another 5 songs passed and I started debugging, 5 more songs and I had it working. The result would check Twitter every 30 seconds or so looking for new songs, next a youtube search for the new song's title and then open a new browser tab with the highest ranked search result.

The pros:
- The hottest 100 as a music video marathon!
- No interruptions, no stopping for phone calls to drunken Australia Day parties

The cons:
- Occasional silence between songs while the DJs talk
- A new browser tab for each song (having to close them all kind of sucked)
- In one case the song wasn't in the top page of results "Friend in the Field" by Art vs. Science.
- Not a general solution, only worked during the hottest 100.

If I didn't pull this together over 30 minutes or so I would have done it differently, maybe as a bit of javascript that messed around with the src of an iframe (or embed tag) based on the output of an AJAX query to the twitter components.

A link for anyone who's curious as to how the hottest 100 turned out.

No comments:

Post a Comment