Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Created September 17, 2008 09:29
Show Gist options
  • Save ELLIOTTCABLE/11219 to your computer and use it in GitHub Desktop.
Save ELLIOTTCABLE/11219 to your computer and use it in GitHub Desktop.
%w[rubygems open-uri hpricot].each {|dep| require dep }
(1..10000).each do |n|
doc = Hpricot( open("http://google.com/search?q=#{n}") )
results = (doc/'#ssb'/'p'/'b')[2].inner_html.gsub(',', '').to_i
puts "#{n}:\t#{results}"
break if n == results
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment