Skip to content

Instantly share code, notes, and snippets.

@thesurlydev
Created September 26, 2009 13:48
Show Gist options
  • Save thesurlydev/194228 to your computer and use it in GitHub Desktop.
Save thesurlydev/194228 to your computer and use it in GitHub Desktop.
Google search
require 'rubygems'
require 'scrubyt'
google_data = Scrubyt::Extractor.define do
fetch 'http://www.google.com/search?hl=en&q=ruby+-weight'
link_title "//a[@class='l']", :write_text => true do
link_url
end
snippet "//div[@class='s']"
next_page "Next", :limit => 1
end
p google_data.to_xml.gsub(/ - Cached - Similar/, '')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment