Check Out My Melody
I’m a fairly big fan of music and I always find it interesting to see what others are listening to. So, with that in mind, I decided I wanted to post a listing of recent songs from my playlist. I did a quick search on the Goog and found Steve Smith’s OrderedTunes, a nice little piece of code that makes it quite easy.
It uses a PHP script running locally to parse the iTunes Music Library.xml file and upload this info to a file on a remote web server. Then, all you need to do is pull this file into the desired page using a PHP (or server-side) include—pretty easy stuff for many people.
What made it a little more interesting for me was finding a way to schedule the PHP script to run at set intervals so that I don’t need to constantly run the page manually. With OS X, the obvious choice for this is crontab, but I haven’t done any UNIX work in almost 10 years so it took a little while to get it working. After spending some time working through an O’Reilly tutorial I managed to get everything working fine and the PHP script is now scheduled to run every hour that the PowerBook is turned on.
And with that, I’m proud to present a sampling of my playlist in the left sidebar, but please be gentle if anything embarrassing comes up.
Leave a Comment