Skip to content

Instantly share code, notes, and snippets.

@mnot mnot/cgmailstats.rb forked from rubys/cgmailstats.rb
Last active Aug 29, 2015

What would you like to do?
require 'nokogumbo'
require 'date'
require 'json'
start = - 105
results = {}
index = ''
groups = Nokogiri::HTML5.get(index)
groups ='a.h3').map {|a| a['href'].sub(/^#/, '')}
groups.each do |group|
list = "{group}"
doc = Nokogiri::HTML5.get(list)
count = 0'tbody tr').each do |tr|
next if'td').text == 'n/a'
count +='td').last.text.to_i if date > start
results[group] = count
puts JSON.pretty_generate(results)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.