« Welcome to the new design! | Main | Gettin' Grub with Grandpa »

iTunes/iPod Trending

So, now that the new website is running I thought it would be cool to do something with all the metadata which sits on my iPod and in iTunes. I could do something like a “Currently listening to…” in a sidebar on the website, but something which would be even cooler would be to do some trending of usage.

iTunes has fields for play count, last played date, date added. Therefore, my thought was that a simple routine could be run periodically against the library which would pick out the current play count for each track and store it in another database with a timestamp.

Then I could run reports…which tracks were the most popular in the last week? Which ones had fallen from favor? Then to complete the cycle, it could use the iTunes API to create a playlist with the results.

The problem with this whole setup - there’s no unique ID which one can use to match between iTunes sessions. All of the Apple documentation I’ve been able to find reiterates over and over again that the trackDatabaseID, which one would think would be what I was looking for, is only guaranteed to be static during an iTunes session.

Now, I suppose I could try and create a unique ID by storing something in an ID3 tag or using a combination of other attributes, and I may just do that. But it still is kinda a pain.

Comments (1)



did you try to implement with TrackDatabaseID? All four are not persistent but maybe the TrackDatabaseID does not change.. Did you play around with it? I am playing with it now, trying to see if it actually changes between sessions..

Any idea how to use the API without the app actually coming up? If you have any thoughts, drop me an e-mail, maybe we can work out something.


This page contains a single entry from the blog posted on October 7, 2004 3:34 PM in Music and Play.

The previous post in this blog was Welcome to the new design!.

The next post in this blog is Gettin' Grub with Grandpa.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.34