-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More cool structure and added a simple test.
- Loading branch information
1 parent
3b0e6f3
commit 345a460
Showing
4 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |