[Playlist] xspf over json

Chris Anderson jchris at mfdz.com
Fri Apr 27 19:44:19 UTC 2007


I wrote to the list before about my application's use of xspf
serialized to a json format. We're in the process of deploying
Grabb.it, and we need a mime-type to call our newfangled format. I
know nothing about the official channels for this sort of thing, but I
would like to at least come up with something sensible, should it take
hold outside of Grabb.it

Is there any choice better than application/xspf+json ?

Below is an example of the format, and its xspf 'equivalent'. I also
have a javascript xspf parser which translates xspf to xjs, that I
plan to release under an open source license.

Here's an example of the format, which we're calling xjs: (I tried to
add human friendly indentation)

{ title: "Alan Singley on Music For Dozens",
  tracks: [
    {
      locations: ["http://local.grabb.it/tracks/bc216dfd4275.mp3"],
      title: "Sitting Silent",
      trackNum: 4,
      annotation: "Sitting Silent by Alan Singley",
      identifiers: ["http://grabb.it/tracks/bc216dfd4275"],
      duration: null,
      image: "http://mfdz.com/image/profile/760.jpg",
      extensions: {"http://grabb.it": {
        stars: 1,
        artist_id: 8,
        gid: "bc216dfd4275"}},
      info: "http://grabb.it/tracks/bc216dfd4275",
      album: "Less Paul, More Rock",
      creator: "Alan Singley"
    },{
      locations: ["http://local.grabb.it/tracks/84180f5208ab.mp3"],
      title: "It's OK When It's Just You & I",
      trackNum: null,
      annotation: "It's OK When It's Just You & I by Alan Singley",
      identifiers: ["http://grabb.it/tracks/84180f5208ab"],
      duration: null,
      image: "http://mfdz.com/image/profile/760.jpg",
      extensions: {"http://grabb.it": {
        stars: 1,
        artist_id: 8,
        gid: "84180f5208ab"}},
      info: "http://grabb.it/tracks/84180f5208ab",
      album: null,
      creator: "Alan Singley"
    },{
      locations: ["http://local.grabb.it/tracks/84887bce1749.mp3"],
      title: "March 23",
      trackNum: null,
      identifiers: ["http://grabb.it/tracks/84887bce1749"],
      annotation: "March 23 by Alan Singley",
      duration: null,
      image: "http://mfdz.com/image/profile/760.jpg",
      extensions: {"http://grabb.it": {
        stars: 0,
        artist_id: 8,
        gid: "84887bce1749"}},
      album: "Secretly Awesome",
      info: "http://grabb.it/tracks/84887bce1749",
      creator: "Alan Singley"
    }
  ],
 location: "http://grabb.it/playlists/c9604a313857",
 annotation: null,
 extensions: {"http://grabb.it": {gid: "c9604a313857"}},
 info: "http://mfdz.com/alan",
 creator: null
}

This is the same playlist as xspf+xml:

<?xml version="1.0" encoding="UTF-8"?>
<playlist xmlns="http://xspf.org/ns/0/" version="1">
  <title>Alan Singley on Music For Dozens</title>
  <creator/>
  <info>http://mfdz.com/alan</info>
  <annotation/>
  <location>http://grabb.it/playlists/c9604a313857</location>
  <extension application="http://grabb.it">
    <gid>c9604a313857</gid>
  </extension>
  <trackList>
    <track>
      <creator>Alan Singley</creator>
      <title>Sitting Silent</title>
      <annotation>Sitting Silent - Alan Singley</annotation>
      <album>Less Paul, More Rock</album>
      <trackNum>4</trackNum>
      <image>http://mfdz.com/image/profile/760.jpg</image>
      <location>http://local.grabb.it/tracks/bc216dfd4275.mp3</location>
      <identifier>http://grabb.it/tracks/bc216dfd4275</identifier>
      <info>http://grabb.it/tracks/bc216dfd4275</info>
      <extension application="http://grabb.it">
        <artistid>8</artistid>
        <gid>bc216dfd4275</gid>
      </extension>
    </track>
    <track>
      <creator>Alan Singley</creator>
      <title>It's OK When It's Just You &amp; I</title>
      <annotation>It's OK When It's Just You &amp; I - Alan Singley</annotation>
      <image>http://mfdz.com/image/profile/760.jpg</image>
      <location>http://local.grabb.it/tracks/84180f5208ab.mp3</location>
      <identifier>http://grabb.it/tracks/84180f5208ab</identifier>
      <info>http://grabb.it/tracks/84180f5208ab</info>
      <extension application="http://grabb.it">
        <artistid>8</artistid>
        <gid>84180f5208ab</gid>
      </extension>
    </track>
    <track>
      <creator>Alan Singley</creator>
      <title>March 23</title>
      <annotation>March 23 - Alan Singley</annotation>
      <album>Secretly Awesome</album>
      <image>http://mfdz.com/image/profile/760.jpg</image>
      <location>http://local.grabb.it/tracks/84887bce1749.mp3</location>
      <identifier>http://grabb.it/tracks/84887bce1749</identifier>
      <info>http://grabb.it/tracks/84887bce1749</info>
      <extension application="http://grabb.it">
        <artistid>8</artistid>
        <gid>84887bce1749</gid>
      </extension>
    </track>
  </trackList>
</playlist>



-- 
Chris Anderson
http://jchris.mfdz.com



More information about the Playlist mailing list