[Playlist] Re: xspf over json
Chris Anderson
jchris at mfdz.com
Fri May 4 20:37:10 UTC 2007
I've cleaned up my Javascript XSPF parser for release. You can run the
unit specs here:
http://jchris.mfdz.com/jspf/xspf_parser_spec.html
And the code is available from my public subversion repository here:
http://svn.rtra.in/public/plugins/jspf/
The license is LGPL, and the specs are passing in Safari, Camino, and
Firefox. The unit spec document format makes for extremely easy to add
requirements. Just add a fixture file and write some assertions. There
are big swaths of the XSPF standard this parser does not yet attempt
to handle. The challenge is to make handle all valid XSPF documents,
without sacrificing readability for the core music metadata.
As far as moving the parser forward, I'd be happy to do the Javascript
gruntwork if people can supply me with fixtures and assertions about
how some of the missing subnodes should be parsed.
If you check out the files work from your local machine, be forwarned
that some browsers (cough... Camino) don't provide an XML DOM object
for file:// requests. Also, XSPF served under non-xml mime types is
not parsable by this library - although I think there may be some
tricks in the YUI project for getting an XML DOM out of documents
served with the wrong content type.
This is very much a work in progress, so I am eager for all input. The
JSPF defined by this parser is in production use on Grabb.it now.
Those of you interested in checking Grabb.it out are welcome to. We're
running the new application on http://preview.grabb.it. You can see
some of our XSPF here:
http://preview.grabb.it/stars.xspf
or look at the same playlist in JSPF if you like:
http://preview.grabb.it/stars.jspf
Chris
--
Chris Anderson
http://jchris.mfdz.com
More information about the Playlist
mailing list