[Playlist] xspf/json
Chris Anderson
jchris at mfdz.com
Sun Feb 18 00:00:52 UTC 2007
I'm working on a javascript xspf parser (turns out to be very simple)
and now I'm interested in doing some ajax stuff with a json transport.
My goal is to build a json string which evaluates to the same data
structure my parser has been producing (so far I've only worked on the
track element). My first attempt looks like this:
{"tracks":[{"location":"http://example.com/song.mp3","annotation":null,"identifier":"http://music.co/tracks/11","title":"Track
Title","album":"Album Title","creator":"Artist
Name","trackNum":3,"duration":51200,"info":"http://music.co/tracks/11"},{"location":"http://example.com/more.mp3","annotation":"Track
by Artist","identifier":"http://music.co/tracks/3","creator":"Unknown
Artist","image":"http://example.com/more.jpg"}]}
The parser code is at http://pastie.caboo.se/41127
If anyone can give me tips about how to fit the extension, meta and
link elements into json I'd be much obliged. I'll probably be
extending the json myself, and I'd like to do so in a way that
maintains its equivalence with the xspf format.
--
Chris Anderson
http://jchris.mfdz.com
More information about the Playlist
mailing list