Well, I got curious so I went ahead and wrote up a little script to grab some basic stats from my iTunes data. I figured others might be interested in this as well, so I’ve packaged it up as a download.

What it does right now:
- Imports a Library.xml export from iTunes into a MySQL database.
- Runs a couple of queries as example reports.
This is totally unpolished at this point and requires PHP 5+ and MySQL 4+.
Installation
- At the top of the index.php file is the SQL for creating your database.
- After you create your database, put your database settings in the config.inc.php file.
- Export your iTunes music as ‘Library.xml’ and put the Library.xml file into the itunes_stats folder.
- Load the index.php page in your browser and click on the “Load data” option to import the XML into MySQL.
- Click on reports, etc.
I’ve added forums for ideas/mods/support. I’d love for you to write your own reports and send them in or post them in the forums.
Popularity: 17% [?]
manuel adds this Comment:
looks nice.. but i can’t find the download link
August 30th, 2005 at 3:43 am
Greg adds this Comment:
It’s the “Download” text right below the screen cap.
August 30th, 2005 at 8:26 am
alexking.org: Blog adds this Trackback:
Modular Reports for iTunes Stats
It occurred to me that if I really wanted people to contribute reports for iTunes Stats, I should make it a little easier to build the reports separately. I’ve posted a new version that takes a step in that direction.
Download
Reports are now …
August 30th, 2005 at 10:52 am
Mark Rickert adds this Comment:
Hey there… i’m working on a version that allows PHP 4.3.X since most webserver don’t have PHP 5 yet and the user can’t help this.
i’m just about done and will email you when i am done.
August 30th, 2005 at 1:58 pm
yo adds this Comment:
http://www.itunesregistry.com
sorry dude
August 30th, 2005 at 8:42 pm
Caroline :) adds this Comment:
wow. very cool. from concept to program in 3 days! nice.
August 30th, 2005 at 9:14 pm
Spun » alexking.org: Blog > iTunes Stats adds this Pingback:
[…] Either way, I’ve posted my iTunes library reports using Alex’s app. alexking.org: Blog > iTunes Stats [Alex King] […]
August 31st, 2005 at 6:51 am
SeƱor Epiphyte adds this Comment:
Check with your ISP, mine allows php5 by either using .php5 or by inserting the following into the .htaccess file within the itunes_stats folder: ‘AddHandler application/x-httpd-php5 .php’
You might also be able to install both locally and use similar trickery.
I think my XML file is too large, I receive a lot of errors ‘out of memory’, the first few lines
Warning: Memory allocation failed in /www/htdocs/php/itunes_stats/index.php on line 48
Warning: Library.xml:169017: parser error : Memory allocation failed : xmlSAX2Characters in /www/htdocs/php/itunes_stats/index.php on line 48
September 18th, 2005 at 1:56 pm
Jon Lesser adds this Comment:
This is great! Thanks.
December 18th, 2005 at 4:17 pm
pyromaster adds this Comment:
it was tough to get the thing in the widgets ans i still havent gotten it and so ya im stuck
February 13th, 2006 at 2:51 pm
A look at iTunes statistics options : tunequest: no repeats adds this Pingback:
[…] iTunes Stats (different from above) This method will show you the artists with the highest ranking, weighted by the number of rated songs. Possibly more. […]
September 4th, 2006 at 10:09 am
berndnow.com adds this Comment:
nice tool - great work !
on my localhost its working !
on my www site i have only PHP 4.4.4
other idea:
run on localhost php5+ and copy/paste generated html code directly on your www homepage (with older php version)
(webserver localhost with
http://www.apachefri[...]windows.html
http://berndnow.be.f[...],169,0,0,1,0)
so i found another very small and simple script to convert itunes xml to html
iTunes XML Playlist Reader
from Richard James Kendall
http://www.rjk-hosti[...]rog.php?id=9
lg bernd
October 1st, 2006 at 3:17 am
Eise van Dijk adds this Comment:
Great stuff. Had to change php.ini (got a timeout during import) but after that no problems.
November 19th, 2006 at 3:09 am
Brian adds this Comment:
thanks! i have 34000 songs, 15000 of which are rated, this is exactly what I was looking for. it revealed some very interesting information. i too had to change max_execution_time
March 27th, 2008 at 2:40 pm