forked from creeky/barney
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.rb
More file actions
executable file
·86 lines (69 loc) · 1.56 KB
/
main.rb
File metadata and controls
executable file
·86 lines (69 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/ruby
#Script um Daten von allen Seiten auf einmal zu sammeln
sports = Array.new
anbieter = Array.new
outputdir = ""
argmode = "none"
ARGV.each do |arg|
case arg
when "-o" then argmode = "outputdir"
when "-a" then argmode = "anbieter"
when "-s" then argmode = "sports"
else
case argmode
when "none"
puts("Hilfe", "Optionen:", " -s Sport/Liga", " -o Ausgabeverzeichnis", " -a Anbieter")
exit(0)
when "sports"
sports.push(arg)
when "outputdir"
outputdir = arg
argmode = "none"
when "anbieter"
anbieter.push(arg)
end
end
end
if(sports.empty?())
sports = ['Baseball/MLB']
end
if(outputdir == "")
outputdir = "output"
end
if(anbieter.empty?())
anbieter = ["pinnacle", "intertops", "expekt", "bwin", "sportingbet"]
end
# pinnacle:
if(anbieter.include?("pinnacle"))
require 'pinnacle.rb'
s = PinnacleScraper.new(sports)
s.get_odds()
s.write_to_file( outputdir + "/pinnacle.xml")
end
# intertops:
if(anbieter.include?("intertops"))
require 'intertops.rb'
s = IntertopsScraper.new(sports)
s.get_odds()
s.write_to_file( outputdir + "/intertops.xml")
end
# expekt:
if(anbieter.include?("expekt"))
require 'expekt.rb'
s = ExpektScraper.new(sports)
s.get_odds()
s.write_to_file( outputdir + "/expekt.xml")
end
# bwin:
if(anbieter.include?("bwin"))
require 'bwin.rb'
s = BWinScraper.new(sports)
s.get_odds()
s.write_to_file( outputdir + "/bwin.xml")
end
if(anbieter.include?("sportingbet"))
require 'sportingbet.rb'
s = SportingbetScraper.new(sports)
s.get_odds()
s.write_to_file( outputdir + "/sportingbet.xml")
end