LGF

more options

  

Advertisement

Tech Note: Ajax and Timers and Tunes

Fri, Jul 25, 2008 at 3:52:18 pm PDT

The “Now Playing” section of our left sidebar, which is set up to show the music or other weird sounds that are currently playing in iTunes on my machine, now updates in an “almost live” fashion. With Ajax and a Javascript timer, it checks the server every 20 seconds to see if there’s been a song change, then does a fade-in effect with any new artwork and song info.

The Ajax code on the server sends back a very small JSON message if the song hasn’t changed since the last check, to keep server impact to a minimum. So far, on a Friday afternoon with traffic down a bit because everyone’s been bludgeoned into political comas by this endless week of Obamaton grandstanding, the web server doesn’t seem to be struggling at all.

On a related subject, I still get occasional email asking how to hear the music that shows up under “Now Playing.” Well, I can’t stream it here without paying absurd licensing fees through the usual suspects, of course. Anyone remember Napster? No? That’s why.

The album cover is a link to the record’s page at Amazon, though, and they usually supply some kind of preview. If the album’s available in their MP3 Store, you can listen to samples right there. So that’s better than nothing, if you’re really curious about why I’m listening to that horrible Rob Zombie album again.

Advertisement

427 comments

^ back to top ^

log in
Name:
Pass:

Register Forgot Your Password? My Account Re-send Confirmation (To log in, cookies must be enabled in your browser!)

► LGF Headlines

► Top 10 Comments

► Bottom Comments

► Recent Comments

► Tools/Info

► LGF Hits

► Slideshows

► Resources

► Never Forget

► Statistics

► Tag Cloud

► Contact

You must have Javascript enabled to use the contact form.
Your email:

Subject:

Message:


Messages may be published in our weblog, unless you request otherwise.
Tech Note:
Using the Contact Form

► News/Opinion

The Beatles Are Here. Reissues and Rock Band.
Blockbuster_TotalAccess 50% off
More Partners

Compare Electricity Prices in your area. Texas Electricity is deregulated; you have the right to choose Texas Electric Rates from among many Texas Electric Companies.

The on going rethoric of Darwinst Rage Boy.


PC & Video Games