Archive for the 'XSPF' Category

XSPF Clean Up

November 22, 2006

Our friend Paul Lamere has been working on some interesting new XSPF tools that integrate with the Musicmobs API. We’ve cleaned up our XSPF output to be more compliant with the spec, but as a result the iTunes Music Store links in Mobster are now broken. We’ll try to get new versions out ASAP. Until then, the itms links on the web site are still functional as a workaround.

Playing XSPFs in Rhapsody – REST API

August 24, 2006

One of the main features of the new version of Musicmobs is the ability to play playlists in Rhapsody. What you might not know is that the REST API we’ve created can be used to open other XSPF files into Rhapsody as well.

If you look at any of the “Play” links on Musicmobs, you’ll notice URLs that look like this:

http://www.musicmobs.com/player?xspf=http://xspf.musicmobs.com/playlist/ellie117/Indie.xspf

The key is the ?xspf= query string. As long as the XSPF you’re trying to open is hosted on the web, and properly marked up with metadata (<creator>, <album> and <title> elements for each track) our player should be able to grab it and do its best to find the songs in Rhapsody.

Where do you find playlists to open? For now there are really only two places you can get properly marked up XSPFs: Musicmobs and Last.fm. Finding XSPFs on Musicmobs is easy enough, but Last.fm takes a little digging.

If you look at the Audioscrobbler Web Services page you’ll see that they expose various data feeds in XSPF format. Any of these URLs should be valid to use with our REST API.

For example this URL will play the top tracks tagged ‘Rock’ on Last.fm:

http://www.musicmobs.com/player?xspf=http://ws.audioscrobbler.com/1.0/tag/Rock/toptracks.xspf

The one caveat is that Last.fm doesn’t include the <album> element in their XSPFs. This means that our player will only find the song in Rhapsody after it’s been cached from the Rhapsody Web Services API at least once. Since our cache is continuously being filled, our matching will improve over time.

Finally, since it’s unlikely that you want the player to load (and therefore resize) your current window, it’s best to add target=”_blank” to any player URL. The finished product should look something like this:

<a href=”http://www.musicmobs.com/player?xspf=http://xspf.musicmobs.com/playlist/ellie117/Indie.xspf&#8221; target=”_blank”>Indie Playlist</a>

Also, if anyone knows of other web sites that you can get fully marked up XSPFs, please leave a comment and we’ll check it out.