Raspagem da dados com Hpricot e Sinatra
Upcoming SlideShare
Loading in...5
×
 

Raspagem da dados com Hpricot e Sinatra

on

  • 1,391 views

 

Statistics

Views

Total Views
1,391
Views on SlideShare
1,369
Embed Views
22

Actions

Likes
0
Downloads
7
Comments
0

2 Embeds 22

http://gurusp.org 20
http://www.gurusp.org 2

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

Raspagem da dados com Hpricot e Sinatra Raspagem da dados com Hpricot e Sinatra Presentation Transcript

  • $ 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-455827/' tempo = Hpricot(open(url).read) (tempo/"[@id='yw-temp']").inner_text // 27°
  • 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°
  • 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°
  • 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
  • O que fazer com isso?
  • Obrigado! { name: 'Emerson Vinicius', twitter: '@emersonvinicius', gtalk: 'duke.m16', github: 'emersonvinicius ' }