Log in

No account? Create an account
entries friends calendar profile my webpage Previous Previous Next Next
Latest bit of geekiness... - Tina Marie's Ramblings
Red hair and black leather, my favorite colour scheme...
Latest bit of geekiness...
I've been wanting to put my iPod playlists on the web for a while now. But the iPod XML format is terrible, and my previous attempts at a transform to HTML had failed miserably.

But today I spent a lot of time watching my complier compiling, so I had time to figure out a transform that works.

( My iPod Music Page )

Since the transform was a pain, and I didn't see any on the 'net that really worked, anyone who wants it is welcome to grab it. It works with my 2.7 meg library file, reasonably fast. You can find it here.

This leads to a rant: Why do people take data which would be better represented as comma-delimited text and wrap it badly in XML? There were so many more logical ways to export that data then what Apple chose....

And a request: I'm always in search of new music. Wander my library, and if you know something that I don't have, but that sounds like something I'd like, leave me a comment...

Current Mood: geeky geeky

3 comments or Leave a comment
(Deleted comment)
skywhisperer From: skywhisperer Date: July 1st, 2005 05:49 am (UTC) (Link)
I'm still playing a bit with it, but it seems to work great. Mine is a 6 gig iPod, and it's taking about a minute or two on a 1.3Ghz machine to generate all 5 of the HTML files.

I expect it will scale linearly.
alioth1 From: alioth1 Date: July 2nd, 2005 09:37 pm (UTC) (Link)
XML is like violence. If what you have isn't working, use more!

Actually, for many things XML makes a lot more sense than comma-separated files. Consider:
- future-proofing - if you need to add a record to a comma-delimited file, all your existing devices suddenly don't work because now there's an extra field.
- self-describing - you don't forget what a column is for.
- validation - it's easy to make XML automatically validate

Apple uses XML for all its configuration files, and it's the format for Cocoa (i.e. NeXTstep) property lists, so it's not surprising they use XML for this, because when you call NSDictionary's save method that's what it makes. If you're going to limit the file formats you save at, XML is quite a nice format to use rather than randomly differnet CSV columns which have no self-validation or self-documentation features.
alioth1 From: alioth1 Date: July 2nd, 2005 09:46 pm (UTC) (Link)
Oh, additionally, for some things (I don't know what the iPod playlist looks like in XML so I can't say), try Perl's XML::Simple instead of a transform, you may find it easier for some things. Alternatively, if you wanna download GNUstep, you can always use Obj-C and NSDictionary :-)
3 comments or Leave a comment