WordPress, I really love you.

Have I mentioned that WordPress is awesome lately? Today I needed to dynamically create an XSPF playlist for a website mp3 player. There’s a great XSPF player available over at Sourceforge that my client wanted to use. XSPF is just an XML dialect, so it shouldn’t be too tough to output from WordPress, right?

My plan was to make a special category of links in WordPress. Call it something special (how’s about “Playlist”) and add a bunch of links to .mp3 files posted out on the ol’ internet.

Couldn’t find a plugin to do exactly what I wanted, but I knew the Podcasting Plugin basically extended the RSS functionality of WordPress to add special tags to the feed. Looking at the source of WP, as well as the Podcasting plugin, it became almost trivial to write a plugin to create a special “feed” format (xspf). From there, I created a template XSPF file, and pulled the links with the get_bookmarks command. (Note that I use the word “feed” in quotes, as XSPF is not really intended as a “feed” format to my knowledge.)

WordPress’s documentation is excellent. Their coding standards are awesome – that’s what makes this quick synthesis and creation possible. I hope to do a little more work with this plugin, so I can push it to the WordPress Plugins archive. I really love this piece of software, and if I can, I want to contribute when I extend it in a useful way.

Take a look over here if you’d like to use the XSPF plugin yourself.

This entry was posted in Code. Bookmark the permalink.