LGF Extreme Code Makeover - Auto Playlist Generator

Charles Johnsonfollow me on twitter
Sun Dec 10, 2006 at 4:06 pm PST • Views: 179

The process of posting those occasional MP3 playlists has been way too much work; that’s one reason why they’re only “occasional.”

So the newest addition to our Lizardoid Extreme Code Makeover project is a sweet, well-behaved little application that automatically generates an XML playlist. Since creating the XML list was one of the most tedious, time-consuming, and error-prone parts of the playlist procedure, this should make things much easier.

For this one, I didn’t use an off-the-shelf script. I cooked up a PHP solution of my own, with help from an open source PHP class called getID3 to read the track title, artist, and album names directly from the MP3 files. My code then uses this information to build an XSPF playlist (a specialized sort of XML file), sends the correct Content-Type header, then feeds the playlist to the Flash-based XSPF MP3 player.

All I have to do is upload the MP3 files (and the album cover images) to a folder, then call the playlist generator with the name of the folder.

This is the first public test; if everything works, you should see a playlist containing five songs (now six) below:

[Audio removed.]

UPDATE at 12/10/06 4:26:43 pm:

While I was working on this code, a bug crept into it and took LGF offline for a few minutes. The critter’s now defunct.

Advertisement

176 comments

^ back to top ^

Name:

Pass:

Register Forgot Your Password? 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

► 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.

7 out of 10 laboratory mice prefer it.

TwitterFacebook
LGF Pages
Recent Pages

Daniel Ballard
Video and Photos: SpaceX's Rendezvous With the Space Station
3 hours ago
Views: 50 • Comments: 2
Tweets: 0 • Rating: 0

Michael McBacon
Kansas governor signs 'Shariah bill' to ban Islamic law
3 hours, 18 minutes ago
Views: 98 • Comments: 5
Tweets: 0 • Rating: 3

MikeySDCA
Glenn Beck in Exile: Don't cry for the former Fox star—he's building a 24/7 media empire in his loopy image.- the Atlantic
3 hours, 20 minutes ago
Views: 65 • Comments: 0
Tweets: 0 • Rating: 0

researchok
How Did Wisconsin Become the Most Politically Divisive Place in America?
14 hours, 14 minutes ago
Views: 174 • Comments: 1
Tweets: 0 • Rating: 2

Aigle
National Geographic Traveler Veers Off Track
1 day, 3 hours ago
Views: 354 • Comments: 3
Tweets: 0 • Rating: -5

MichaelJ
Apple TV Slated to Debut in December?
1 day, 4 hours ago
Views: 182 • Comments: 0
Tweets: 0 • Rating: 1

Ascher
Israeli Who Saved Turk on Everest: You Never Abandon a Friend - Israel News, Ynetnews
1 day, 5 hours ago
Views: 242 • Comments: 1
Tweets: 0 • Rating: 3

Haywood Jabloeme
The Harrassment of Patterico & Its Roots in Left-Wing Activism
1 day, 5 hours ago
Views: 453 • Comments: 2
Tweets: 0 • Rating: 4

Curt
Brian Banks: (Video) Falsely accused of rape speaks out
1 day, 8 hours ago
Views: 220 • Comments: 1
Tweets: 0 • Rating: 3

Mickey_being_mickey
Obama Administration begins to form plan to arm Syrian rebels
1 day, 22 hours ago
Views: 214 • Comments: 2
Tweets: 0 • Rating: 1

 Frank says:

Anything over a mouthful is wasted.