Rhapsody Unlimited and PHP with SimplePie
A couple of months ago, I started using Yahoo's Unlimited Music service. Access to the complete spectrum of big and medium label music was great and allowed me to do any CD spending on independent artists and still get to listen to whatever I wanted.
However, I am a software developer and was disappointed that the primary development toolkit for working with Yahoo Music is within their player as plugins. As I'm more interested in piping the information elsewhere, I pretty much abandoned doing anything with their toolkit.
Then, last week, I noticed that Rhapsody released some tools for working with their service. This included some RSS feeds of recently played items. That just so happens to be one of the things I've been looking for. There are plenty of tools to track what you play in Winamp or iTunes, but I don't really use them for listening to music. It used to be more of the MP3 player, but now is one of these services when I'm near a computer with the MP3 player filling in the rest, but mostly for mobile access to favorites.
When I listened to a track at the end of the day on Yahoo only to be completely unable to remember the artist's name the next morning, I decided I really wanted programatic access to my music attention data and decided to grab a Rhapsody subscription too. I'll run them side-by-side for a couple of months until I'm sure which one to keep and then ditch the other.
So far, I like Yahoo's player interface better, but don't really like either player. I am one of those guys who shuts all of the XP eye candy off. I hate black/purple/chrome interfaces and just want a basic, simple hookup without it looking like it was aimed at the Fast and the Furious crowd.
Digressions aside, Yahoo still does have a better ratings and recommendation system than Rhapsody, but the API's are making up for that.
So, I decided to give the Rhapsody API's a test run. Since the attention stuff is in RSS, I figured this might be a good time to give the new PHP RSS parser: SimplePie a shot.
I grabbed the most recent artists, albums and songs and put them into a simple page. The PHP code follows.
While it works well for the middle of the bell curve of use cases, SimplePie doesn't appear to have any way to grab the Rhapsody Extensions to RSS for extended artist/album/track information. Lots of these API-styled RSS feeds have extensions of one sort or another and neither SimplePie or Magpie have really good ways to access that information. Unfortunately, that can either mean digging through them "manually" and going without the convenience for the "normal" stuff or doing without.
For now, that simple script is giving me access to what I listened to and I have a better idea of what SimplePie can do, so mission accomplished.
Here's the code to the page for those who are interested.
Read the rest of this entry »

