I use the plist and gruff gems to summarize my iTunes music ratings with Ruby
Introduction
Earlier this year I did a fresh operating system install on my laptop. Part of that install involved moving all my music from an older machine. I moved the music, but not the iTunes details. My tastes changed over the years. Why not start with a fresh listen and fresh ratings for all?
A few months passed. How much progress have I made?
First off let me roll 1d100 and check the Random Language Chart. I rolled a 73, and that means I write this in Ruby.
I decided to look at the XML file that gets exported by iTunes whenever a library detail changes. Property List XML frustrates quickly if you attack it with naive XML parsing. Fortunately, Ben Bleything wrote a plist gem that simplifies the task in Ruby.
Since I like pretty pictures, I may as well use Geoffrey Grosenbach’s gruff to make a pretty pie chart.
Here It Is
No big code explanation this time around. My last few attempts at that have gone stale in my drafts folder. Plus, I’m worn out. I tried the naive XML parsing thing, and it frustrated me quickly. Thank goodness for plist.
graph-ratings.rb
Running it shows me that I have more than a month of music to rate, and only if I can rate music in my sleep.
It seems I still like most of the music I own at least a little bit. Many former favorites have drifted to the 60 rating (3 stars), though. Time does change tastes a little bit.
The graph. Let’s look at that pretty picture.
Yes. I have much music listening ahead of me.
Backlinks
Got a comment? A question? More of a comment than a question?
Talk to me about this page on:
Added to vault 2024-01-15. Updated on 2024-02-01