Hacker News new | past | comments | ask | show | jobs | submit login

(author here)

danielh was pretty much spot-on... The lyrics are stored with a time offset and indentation level (sort of like a player-piano roll) and the list of tweets is updated periodically by the server.

On the browser side, I'm using jQuery and the YouTube chromeless player (http://code.google.com/apis/youtube/js_api_reference.html)

When the page is loaded, I take the lyrics information and generate a sparse array where each index represents a tenth of a second. Then I start an interval timer that runs an update function once every 100 milliseconds. That updater gets the current video time from the YouTube player, converts that time value from milliseconds to deciseconds, grabs all entries from the sparse array between its last run and the current time, and inserts them onto the page (with a 200 ms fadeIn animation).

To be perfectly honest, there really isn't much code involved at all. Most of the development time was spent figuring out the time offset of each word. There was no fancy technology used there... it was just a brute force effort (though perhaps the Mechanical Turk could have been of use?)

I haven't had any coffee yet this morning so please let me know if my explanation was incoherent or if you'd like more info.

Thanks a lot for your detailed response. Many times, I forget treating an app like a black box and instead of enjoying/appreciating it, I think about the underlying stuff that makes it.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact