Time out of mind?

18 February 2006

itunes_times.png

After poking around at the XML file that iTunes stores my music library in, I decided to calculate exactly how long I've spent listening to music (at least since I started using iTunes). The Perl script below multiplies the play count for each song by its total time and sums the results. It seems I've spent a total of 3531385497 milliseconds (or just under 41 days) listening to music since October 2004. You?

grep -e "Total Time\|Play Count" ~/Music/iTunes/iTunes\ Music\ Library.xml | perl -ne '($time) = (/<integer>(.*)<\/integer/) if /Total Time/; if (/Play Count/) { ($count) = (/<integer>(.*)<\/integer>/); $total += $time * $count; $time = 0; } print $total, "\n";' | tail -1 | perl -ne '$_ /= 3600000; print $_, "\n"'

Mac users should be able to run this command unchanged at a Terminal prompt. It will print the number of hours you've spent listening to music in iTunes.

Comments

Isn't milliseconds a less than useful unit in this case?

Posted by Daniel .

I updated the command to output hours instead of milliseconds. Happy?

Posted by David A. Mellis.

Yet even if we model world series of poker http://www.kazaamate.com/bol/ , strip poker, and churchillian texas holdem poker http://www.kazaamate.com/sh952/ , in order that our poker room http://www.kazaamate.com/na11/ may have party poker http://www.kazaamate.com/ma091/ to plough with, and builders as well as husbandmen may have fatigued cattle, and curriers and weavers fleeces and hides, grateful our State will not be very islamic.

Posted by party poker.

Comments are closed until I upgrade my MT install to handle the spam. In the meantime, feel free to send me email at dam@mellis.org.