For a while now I've been meaning to create an interface so selected friends can search my iTunes Library.
The problem is that the iTunes database is actually a pretty dense piece of XML.
I figured the fastest solution lay in trying to somehow get this data into MySQL and to create a search interface.
The good thing is that the iTunes database is XML, so all I needed to do was somehow parse that.
The problem is that my iTunes Library contains somewhat over 5000 songs and the XML file is 7.3 MB large, so using XSL transformations is right out, what with my meagre skills in XSLT and performance issues.
I did some searching last night and came across the following:
is a PHP script that can import your iTunes Library to MySQL.
The script is somewhat kludgy, but after some timeout issues (after 3000 imported songs) I just ran the script from the commandline and hey presto: everything is imported nicely.
The script imports all kinds of weird stuff but the beauty of writing your own search interface is that you can just ignore all those fields and focus on the meaningful ones.
I still have some tweaking to do but when it's finished I'll share the script. In the meantime have fun importing your own database to MySQL.