iTunes Stats

Posted in: Music, Development, Software

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.

iTunes Stats

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

  1. At the top of the index.php file is the SQL for creating your database.
  2. After you create your database, put your database settings in the config.inc.php file.
  3. Export your iTunes music as ‘Library.xml’ and put the Library.xml file into the itunes_stats folder.
  4. Load the index.php page in your browser and click on the “Load data” option to import the XML into MySQL.
  5. 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: 16% [?]

Posted August 29th, 2005 @ 4:42 PM

14 Replies

  1. manuel adds this Comment:

    looks nice.. but i can’t find the download link :)

    August 30th, 2005 at 3:43 am

  2. Greg adds this Comment:

    It’s the “Download” text right below the screen cap.

    August 30th, 2005 at 8:26 am

  3. 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

  4. 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

  5. yo adds this Comment:

    August 30th, 2005 at 8:42 pm

  6. Caroline :) adds this Comment:

    wow. very cool. from concept to program in 3 days! nice.

    August 30th, 2005 at 9:14 pm

  7. 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

  8. 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

  9. Jon Lesser adds this Comment:

    This is great! Thanks.

    December 18th, 2005 at 4:17 pm

  10. 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

  11. 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

  12. 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

  13. 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

  14. 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

Add a Comment

Please note: Use of a non-personal web site or blog in the field below and/or comments that are off-topic, personal attacks, or support requests will likely be removed at my discretion.

Note: This post is over 2 years old. You may want to check later in this blog to see if there is new information relevant to your comment.

Modular Reports for iTunes Stats » « Theme Browser Non-functional

About This Site

This is the personal web site of Alex King, an independent developer based in Denver, Colorado USA. More...


Crowd Favorite

Crowd Favorite is my software and web development business.

We build web applications, design and develop custom WordPress themes and plugins, and build custom sites using WordPress as a CMS.


I also have a tumblog that aggregates my online content from other services (Twitter, Flickr, del.icio.us. etc.).

Ads