Created
January 19, 2010 03:00
-
-
Save kch/280619 to your computer and use it in GitHub Desktop.
how I can't shut up on the @lettersapp mailing lists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# #### email-init | |
# Caio Chassot....: 18.4% ================== | |
# Jonas Wisser....: 6.8% ======= | |
# Paul Ward.......: 4.7% ===== | |
# Gavin Eadie.....: 4.0% ==== | |
# Jesper..........: 3.7% ==== | |
# Michael Ströck..: 3.6% ==== | |
# Faisal N Jawdat.: 3.4% === | |
# Mo McRoberts....: 3.3% === | |
# Brent Simmons...: 3.1% === | |
# Joe Hildebrand..: 3.1% === | |
# #### letters-dev | |
# Caio Chassot......: 29.0% ============================= | |
# Gus Mueller.......: 12.9% ============= | |
# Michael Ströck....: 11.8% ============ | |
# Michael McCracken.: 11.8% ============ | |
# YC................: 7.5% ======== | |
# Mo McRoberts......: 6.5% ====== | |
# brian pink........: 3.2% === | |
# Jim Puls..........: 3.2% === | |
# Duncan Wilcox.....: 3.2% === | |
# Brent Simmons.....: 2.2% == |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby1.9 -ryaml | |
# encoding: UTF-8 | |
require 'hpricot' | |
require 'open-uri' | |
%w[ | |
http://lists.ranchero.com/pipermail/email-init-ranchero.com/2010-January/author.html | |
http://lists.ranchero.com/pipermail/letters-dev-ranchero.com/2010-January/author.html | |
].each do |url| | |
hcount = (Hpricot(open(url)) / "//body/ul/li/i/").inject(Hash.new(0)) { |h, s| h[s.to_s.strip] += 1; h } | |
total = hcount.values.inject(0, &:+) | |
uppercut = hcount.entries.sort_by(&:last).reverse[0, 10] | |
namelen = uppercut.map(&:first).map(&:length).max | |
percentage = uppercut.map { |name, count| [name, (count * 100.0 / total)] } | |
puts '#### ' + url[/\/([\w-]+)-ranc/, 1] | |
puts percentage.map { |s, f| | |
("%-#{namelen}s : %4.1f%% " % [s, f] + "=" * f.round).sub(/( +)(?=:)/) { $1.gsub(/ /, ".") } } | |
puts | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment