0
$ ruby app.rb
Raspando dados com Sinatra e Hpricot
{
    name: 'Emerson Vinicius',
    github: 'emersonvinicius '
}
Sinatra
require 'rubygems'
require 'sinatra'
get '/hi' do
 "Hello World!"
end
require 'rubygems'
require 'sinatra'
get '/hi' do
 "Hello World!"
end
require 'rubygems'
require 'sinatra'
get '/hi' do
 "Hello World!"
end
require 'rubygems'
require 'sinatra'
get '/hi' do
 "Hello World!"
end
Hpricot
require 'rubygems'
require 'open-uri'
require 'hpricot'

url = 'http://br.weather.yahoo.com/brazil/sao-paulo/sao-
paulo-45...
require 'rubygems'
require 'open-uri'
require 'hpricot'

url = 'http://br.weather.yahoo.com/brazil/sao-paulo/sao-
paulo-45...
require 'rubygems'
require 'open-uri'
require 'hpricot'

url = 'http://br.weather.yahoo.com/brazil/sao-paulo/sao-
paulo-45...
require 'rubygems'
require 'open-uri'
require 'hpricot'

url = 'http://br.weather.yahoo.com/brazil/sao-paulo/sao-
paulo-45...
O que fazer com isso?
Obrigado!
{
    name:       'Emerson Vinicius',
    twitter:   '@emersonvinicius',
    gtalk:     'duke.m16',
    github: ...
Raspagem da dados com Hpricot e Sinatra
Raspagem da dados com Hpricot e Sinatra
Raspagem da dados com Hpricot e Sinatra
Raspagem da dados com Hpricot e Sinatra
Raspagem da dados com Hpricot e Sinatra
Raspagem da dados com Hpricot e Sinatra
Raspagem da dados com Hpricot e Sinatra
Raspagem da dados com Hpricot e Sinatra
Upcoming SlideShare
Loading in...5
×

Raspagem da dados com Hpricot e Sinatra

1,170

Published on

Published in: Self Improvement
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,170
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide






















  • Transcript of "Raspagem da dados com Hpricot e Sinatra"

    1. 1. $ ruby app.rb Raspando dados com Sinatra e Hpricot
    2. 2. { name: 'Emerson Vinicius', github: 'emersonvinicius ' }
    3. 3. Sinatra
    4. 4. require 'rubygems' require 'sinatra' get '/hi' do "Hello World!" end
    5. 5. require 'rubygems' require 'sinatra' get '/hi' do "Hello World!" end
    6. 6. require 'rubygems' require 'sinatra' get '/hi' do "Hello World!" end
    7. 7. require 'rubygems' require 'sinatra' get '/hi' do "Hello World!" end
    8. 8. Hpricot
    9. 9. require 'rubygems' require 'open-uri' require 'hpricot' url = 'http://br.weather.yahoo.com/brazil/sao-paulo/sao- paulo-455827/' tempo = Hpricot(open(url).read) (tempo/"[@id='yw-temp']").inner_text // 27°
    10. 10. require 'rubygems' require 'open-uri' require 'hpricot' url = 'http://br.weather.yahoo.com/brazil/sao-paulo/sao- paulo-455827/' tempo = Hpricot(open(url).read) (tempo/"[@id='yw-temp']").inner_text // 27°
    11. 11. require 'rubygems' require 'open-uri' require 'hpricot' url = 'http://br.weather.yahoo.com/brazil/sao-paulo/sao- paulo-455827/' tempo = Hpricot(open(url).read) (tempo/"[@id='yw-temp']").inner_text // 27°
    12. 12. require 'rubygems' require 'open-uri' require 'hpricot' url = 'http://br.weather.yahoo.com/brazil/sao-paulo/sao- paulo-455827/' tempo = Hpricot(open(url).read) (tempo/"[@id='yw-temp']").inner_text // 27° #WIN
    13. 13. O que fazer com isso?
    14. 14. Obrigado! { name: 'Emerson Vinicius', twitter: '@emersonvinicius', gtalk: 'duke.m16', github: 'emersonvinicius ' }
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×