Skip to content

Instantly share code, notes, and snippets.

@badboy
Created March 18, 2009 15:15
Show Gist options
  • Save badboy/81179 to your computer and use it in GitHub Desktop.
Save badboy/81179 to your computer and use it in GitHub Desktop.
%w(open-uri hpricot).each { |lib| require lib }
BASEURL = "http://www.rubyusers.com"
puts Hpricot(open("#{BASEURL}/users/list")).search("//li[@class^='size_']/a").map { |a|
[a.inner_text, Hpricot(open("#{BASEURL}#{a[:href]}")).search("//p/li").size]
}.sort_by{|e|e[1]}.reverse.map{|e|e*': '}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment