It's a beautiful day in Boston, but I'm stuck inside nursing a head cold. To entertain myself, I started grepping through taskboy's web access logs. Once again, I focused the sifting on my music. I was curious to see the popularity of my tunes. So as not to skew the results too much, I've removed my DSL's IP address. The dates covered by this log are from August 30, 2001 to August 23, 2003. Of course, this report is generated by this perl/shell one-liner:
bash-2.03$ perl -MData::Dumper -MFile::Basename -lane 'next unless $F[6] =~ /\.mp3$/; next if $F[0] eq "151.203.46.214"; push @{$s{basename($F[6])}},$F[0]; END {for my $song (sort {scalar @{$s{$b}} <=> scalar @{$s{$a}}} keys %s) { printf "%30s: %4d downloads\n", $song, (scalar @{$s{$song}}); }}' access.log | head -10
The results surprised me. Here's the top 10 list of my most popular songs:
monkey_vs_robot_jjohn.mp3:
317 downloads
make_the_pie_higher.mp3:
273 downloads
08_without_you.mp3:
189 downloads
plug_nickle.mp3:
171 downloads
careful.mp3:
137 downloads
doubt.mp3:
105 downloads
immigrant_song.mp3:
101 downloads
01_careful.mp3:
98 downloads
m_vs_r_jjohn.mp3:
95 downloads
05_letting_go_remix.mp3:
92 downloads
Why people are downloading my crappy cover of Immigrant Song is way beyond
me (maybe it's kitchy in Canada?). I am pleased that Monkey vs. Robot
seems to amuse folks. It should be noted that I changed the filename of
careful.mp3
to 01_careful.mp3
a while ago. Perhaps I can turn down the suck knob
on that song if I remaster it with my new pro-audio gear. The Soundblaster Live
card really just doesn't cut it.
With more time to kill, I thought find those song with the most diverse support. That is, songs that were downloaded by the greatest number of unique IP addresses. That list is as follows:
make_the_pie_higher.mp3:
157 unique IPs
monkey_vs_robot_jjohn.mp3:
151 unique IPs
08_without_you.mp3:
96 unique IPs
m_vs_r_jjohn.mp3:
64 unique IPs
doubt.mp3:
64 unique IPs
immigrant_song.mp3:
55 unique IPs
careful.mp3:
53 unique IPs
plug_nickle.mp3:
51 unique IPs
05_letting_go_remix.mp3:
49 unique IPs
goodnight.mp3:
46 unique IPs
Ah! So the worm turns! It appears that some of my songs get at least a second listen. That's pretty cool. Some, like Plug Nickle, even get a remarkable third listen.
That's all for now. My head is filling with cotton again.
It's shorter, and more fun, to do-ne'foo; END { bar; }'
-ne'foo}{bar'
Re:We don't need no stinkin' END blocks
jjohn on 2003-08-24T01:10:29
Yes, I know that a while loop is inserted into -e specified code with the -n flag. However, I feel dirty using the those about facing braces. Besides, I don't use END blocks except for these one-liners. I'm a prud.