• Hey Guest. Check out your NeoGAF Wrapped 2025 results here!

My modified iTunes parser

Status
Not open for further replies.

borghe

Loves the Greater Toronto Area
So I wanted a way to decently show off my iTunes/song collection as I work on ripping it (slowly but surely). Found http://codetriangle.com/ and modified it turning it into this. About as far as I am going to take it right now.. Just a way to let others see what I've done. Mainly for friends and whatnot, but I figured I would let you guys look also.

The script is very rudimentary. I could break it up and increase execution time (also could do FastCGI or something if I was so motivated).

I changed the display almost entirely from his example, and added track and album secondary and tertiary sorting to the artist and album sorts.

If anyone wants this, it is pretty straightforward. Your PHP system needs DOMXML installed. Then just stick the parser library, the display page, and your library.xml file in a directory, edit index.php and set $ituneslibrary to your filename (usually library.xml) and it will automatically fill in everything shown on my page.

edit - and for those who don't know, you generate your library.xml file with File->Export Library... in iTunes.
 
On a related note, I have a perl script I wrote that does something similar. If anyone wants it I may put it together into something usable.
 
my collection isn't great, but it's huge. :P this doesn't even finish the discs that are laying around... let alone the ones that are actually stored in the basement (a huge box full o hundreds)

nelson is the woman's from when nelson was big. I am backing up everything, even nelson and bullet boys (well, when I find bullet boys, which I know I have).
 
borghe said:
my collection isn't great, but it's huge. :P this doesn't even finish the discs that are laying around... let alone the ones that are actually stored in the basement (a huge box full o hundreds)

nelson is the woman's from when nelson was big. I am backing up everything, even nelson and bullet boys (well, when I find bullet boys, which I know I have).

Oh I kid. ;)

I have old as hell stuff in my collection (I'll need to rip someday and add to itunes) that would also draw laughs from anyone.
 
Is this just strictly to print out a nice-looking list?

Couldn't you do the same thing by putting everything into a single playlist and exporting the listing?
 
http://www.borgh.us/ituneslist/files.zip

again, you NEED INSTALLED AND WORKING:
PHP
DOMXML for PHP

for windows apache (what I am running this on) this means you need PHP installed as a module AND DOMXML installed, meaning libxml2.dll installed from http://www.zlatkovic.com/pub/libxml/ and the extension uncommented from your php.ini. For other web servers or OSes I don't know.

As long as PHP and DOMXML are installed and working, just unzip the files into a directory, do a File->Export Library... from iTunes, stick that .xml file in the same directory, and edit index.php to point to the file (it defaults to Library.xml but being there could be some private info in the xml file I HIGHLY recommend changing the .xml filename and variable in index.php to something random)

Doing this will render your page EXACTLY as you see on mine, with all the stuff on the header. If you want to change stuff, you have to work with PHP. As a note, like I said, I modified the original parser so that if you sort the page by Artist it will then further sub-sort by Ablum and then tracks on the album. If you sort by albums is will further sort by tracks on the album. Untested if you don't have an album or a track listed though as far as I can see the sort process will always return a value, so you should be safe.

enjoy.
 
holy crap that is a lot of stuff for a simple parsing tool.

yeah, time to pull out the the ruby book and make an HTML version. brain starting to hurt...
 
actually if you have an apache webserver going, chances are all of those but one is already done. the only thing you have to do with any apache install is probably just install DOMXML if it already isn't..

as for THAT being a lot.. well, if you want to work with xml in a server side environment , it makes sense to have an xml parser installed :P
 
Status
Not open for further replies.
Top Bottom