Tech Note: Ajax and Timers and Tunes

Charles Johnsonfollow me on twitter
Fri Jul 25, 2008 at 3:52 pm PDT • Views: 163

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 ^

Name:

Pass:

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

Turn off ads by subscribing!
For about 33 cents a day, our subscription option turns off all advertisements at LGF!
Read more...


► LGF Headlines

  • Loading...

► Tweeted Articles

  • Loading...

► Tweeted Pages

  • Loading...

► Top 10 Comments

  • Loading...

► Bottom Comments

  • Loading...

► Recent Comments

  • Loading...

► Tools/Info

► LGF Hits

► 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

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.

Elephant not interested in using treadmill.

TwitterFacebook
LGF Pages
Recent Pages

Daniel Ballard
Meme: What Photographers Actually Do
8 minutes ago
Views: 20 • Comments: 0
Tweets: 0 • Rating: 0

Aigle
Judi Rudoren Enters the Scene: Tweets or Tea Leaves?
26 minutes ago
Views: 17 • Comments: 0
Tweets: 0 • Rating: 0

Aigle
New Online Newspaper in Israel
27 minutes ago
Views: 23 • Comments: 0
Tweets: 0 • Rating: 0

Daniel Ballard
The Boy Who Played With Fusion
1 hour, 15 minutes ago
Views: 72 • Comments: 0
Tweets: 0 • Rating: 2

wrenchwench
Mexico Issues Travel Warning for Los United Estates
1 hour, 23 minutes ago
Views: 75 • Comments: 0
Tweets: 1 • Rating: 1

Channeling Confucius
6 Terrifying User Agreements You've Probably Accepted
2 hours, 18 minutes ago
Views: 88 • Comments: 0
Tweets: 0 • Rating: 1

Turnabout is Fair Play
The Muslim Brotherhood's Post-Mubarak Anti-Americanism
2 hours, 32 minutes ago
Views: 76 • Comments: 0
Tweets: 0 • Rating: 1

MichaelJ
Daring Fireball: Walter Isaacson's 'Steve Jobs'
2 hours, 47 minutes ago
Views: 85 • Comments: 0
Tweets: 0 • Rating: 0

Bob Dillon
Radiation Generates Cancer Stem Cells From Less Aggressive Breast Cancer Cells
4 hours, 10 minutes ago
Views: 84 • Comments: 0
Tweets: 0 • Rating: 0

Bob Dillon
Mossad Bolsters Activity in Tunisia
4 hours, 30 minutes ago
Views: 85 • Comments: 0
Tweets: 0 • Rating: 0

 Frank says:

Information is not knowledge,
Knowledge is not wisdom,
Wisdom is not truth,
Truth is not beauty,
Beauty is not love,
Love is not music
and Music is THE BEST.