public
Description: A handful (but hopefully growing amount) of scRUBYt! examples
Homepage: http://scrubyt.org
Clone URL: git://github.com/scrubber/scrubyt_examples.git
scrubyt_examples / google.rb
100644 15 lines (10 sloc) 0.268 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#The canonical google example
 
require 'rubygems'
require 'scrubyt'
 
google_data = Scrubyt::Extractor.define do
  fetch 'http://www.google.com/search?hl=en&q=ruby'
  
  link_title "//a[@class='l']", :write_text => true do
    link_url
  end
end
 
p google_data.to_hash