Skip to content

Commit

Permalink
More cool structure and added a simple test.
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeriopvl committed Aug 24, 2011
1 parent 3b0e6f3 commit 345a460
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/scp_homey.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module SCPHome
VERSION = '0.1'
autoload :Runner, 'scp_homey/runner'
end
12 changes: 12 additions & 0 deletions lib/scp_homey/runner.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'cmdparse'

module SCPHomey

class Runner

def initialize

end

end
end
27 changes: 27 additions & 0 deletions lib/scp_homey/scrapper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require 'rubygems'
require 'nokogiri'
require 'open-uri'

module SCPHomey

class Scrapper

# PT_LEAGUE_URL = 'http://desporto.sapo.pt/futebol/primeira_liga/calendario/156'
PT_LEAGUE_URL = 'http://www.sporting.pt/Futebol/Fut_Prof/Liga/futsen_liga_calendario.asp' #get all classes Calendario_Item3
# EUROPE_LEAGUE_URL = 'http://www.sporting.pt/Futebol/Fut_Prof/Liga_Europa/futsen_ligaeuropa_calendario.asp' #same class
EUROPE_LEAGUE_URL = ''

def initialize
puts "TODO"
end

def run
doc = Nokogiri::HTML(open(PT_LEAGUE_URL))
doc.css('tr.Calendario_Item3').each do |item|
puts item.text
end
end

end

end
4 changes: 4 additions & 0 deletions test/test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require '../lib/scp_homey/scrapper.rb'

scp = SCPHomey::Scrapper.new()
scp.run

0 comments on commit 345a460

Please sign in to comment.