LGF Extreme Code Makeover - Auto Playlist Generator
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.



