worldfootball 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/Manifest.txt +5 -12
- data/README.md +36 -1
- data/Rakefile +3 -5
- data/bin/wfb +75 -23
- data/config/leagues_asia.csv +6 -0
- data/config/leagues_europe.csv +75 -0
- data/lib/worldfootball/build-parse_score.rb +156 -0
- data/lib/worldfootball/build.rb +64 -117
- data/lib/worldfootball/cache.rb +46 -0
- data/lib/worldfootball/config.rb +85 -0
- data/lib/worldfootball/convert.rb +15 -116
- data/lib/worldfootball/download.rb +8 -18
- data/lib/worldfootball/leagues.rb +119 -171
- data/lib/worldfootball/mods.rb +9 -2
- data/lib/worldfootball/page.rb +9 -0
- data/lib/worldfootball/page_schedule.rb +60 -8
- data/lib/worldfootball/vacuum.rb +3 -1
- data/lib/worldfootball/version.rb +2 -2
- data/lib/worldfootball.rb +6 -16
- metadata +9 -30
- data/lib/worldfootball/generator.rb +0 -33
- data/lib/worldfootball/leagues/asia.rb +0 -53
- data/lib/worldfootball/leagues/europe--british_isles.rb +0 -64
- data/lib/worldfootball/leagues/europe--central.rb +0 -127
- data/lib/worldfootball/leagues/europe--eastern.rb +0 -82
- data/lib/worldfootball/leagues/europe--northern.rb +0 -57
- data/lib/worldfootball/leagues/europe--southern.rb +0 -86
- data/lib/worldfootball/leagues/europe--western.rb +0 -38
- data/lib/worldfootball/leagues/europe.rb +0 -13
- data/lib/worldfootball/leagues/north_america.rb +0 -44
- data/lib/worldfootball/leagues/pacific.rb +0 -21
- data/lib/worldfootball/leagues/south_america.rb +0 -11
@@ -1,200 +1,148 @@
|
|
1
1
|
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
module Worldfootball
|
4
|
+
class LeagueConfig
|
5
|
+
def initialize
|
6
|
+
@table = {}
|
7
|
+
end
|
8
8
|
|
9
|
+
class LeagueItem # nested inside LeagueConfig
|
10
|
+
attr_reader :key, :slug
|
9
11
|
|
10
|
-
|
12
|
+
def initialize( key:, slug: )
|
13
|
+
@key = key
|
14
|
+
@slug = slug
|
11
15
|
|
12
|
-
|
13
|
-
|
14
|
-
LEAGUES_SOUTH_AMERICA,
|
15
|
-
LEAGUES_PACIFIC,
|
16
|
-
LEAGUES_ASIA].reduce({}) { |mem,h| mem.merge!( h ); mem }
|
16
|
+
@seasons = nil
|
17
|
+
end
|
17
18
|
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
@key = key
|
22
|
-
## @data = data
|
20
|
+
def seasons
|
21
|
+
## auto-(down)load on first request
|
23
22
|
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
@seasons ||= begin
|
24
|
+
### todo/fix:
|
25
|
+
## use from cache if not older than 1 (or 5/10?) hour(s) or such
|
26
|
+
## why? why not?
|
27
|
+
Worldfootball::Metal.download_schedule( @slug )
|
28
|
+
page = Worldfootball::Page::Schedule.from_cache( @slug )
|
27
29
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
# assume always "simple/regular" format w/o stages
|
36
|
-
slug = @pages
|
37
|
-
{ slug: fill_slug( slug, season: season ) }
|
38
|
-
else
|
39
|
-
## check for league format / stages
|
40
|
-
## return array (of strings) or nil (for no stages - "simple" format)
|
41
|
-
indices = @season_proc.call( season )
|
42
|
-
if indices.nil?
|
43
|
-
puts "!! ERROR - no configuration found for season >#{season}< for league >#{@key}< found; sorry"
|
44
|
-
exit 1
|
45
|
-
elsif indices.is_a?( Integer ) ## single number - single/regular format w/o stage
|
46
|
-
# note: starting with 0 (always use idx-1) !!!
|
47
|
-
slug = if @pages.is_a?( Array )
|
48
|
-
@pages[indices-1]
|
49
|
-
else ## assume hash (and key is page slug)
|
50
|
-
@pages.keys[indices-1]
|
51
|
-
end
|
52
|
-
{ slug: fill_slug( slug, season: season ) }
|
53
|
-
else ## assume regular case - array of integers
|
54
|
-
recs = []
|
55
|
-
indices.each do |idx|
|
56
|
-
slug = key = @pages.keys[idx-1]
|
57
|
-
recs << { slug: fill_slug( slug, season: season ),
|
58
|
-
stage: @pages[key] } ## note: include mapping for page to stage name!!
|
59
|
-
end
|
60
|
-
recs
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end # pages
|
64
|
-
|
65
|
-
|
66
|
-
######
|
67
|
-
# helper method
|
68
|
-
def fill_slug( slug, season: )
|
69
|
-
## note: fill-in/check for place holders too
|
70
|
-
slug = if slug.index( '{season}' )
|
71
|
-
slug.sub( '{season}', season.to_path( :long ) ) ## e.g. 2010-2011
|
72
|
-
elsif slug.index( '{end_year}' )
|
73
|
-
slug.sub( '{end_year}', season.end_year.to_s ) ## e.g. 2011
|
74
|
-
else
|
75
|
-
## assume convenience fallback - append regular season
|
76
|
-
"#{slug}-#{season.to_path( :long )}"
|
77
|
-
end
|
78
|
-
|
79
|
-
puts " slug=>#{slug}<"
|
80
|
-
|
81
|
-
slug
|
82
|
-
end
|
83
|
-
end # class League
|
30
|
+
## pp page.seasons
|
31
|
+
=begin
|
32
|
+
[{:text=>"2024/2025", :ref=>"aut-oefb-cup-2024-2025"},
|
33
|
+
{:text=>"2023/2024", :ref=>"aut-oefb-cup-2023-2024"},
|
34
|
+
{:text=>"2022/2023", :ref=>"aut-oefb-cup-2022-2023"},
|
35
|
+
{:text=>"2021/2022", :ref=>"aut-oefb-cup-2021-2022"},
|
36
|
+
=end
|
84
37
|
|
38
|
+
recs = page.seasons.map { |rec| [rec[:text], rec[:ref]] }
|
39
|
+
pp recs
|
40
|
+
puts " #{recs.size} record(s)"
|
41
|
+
recs
|
85
42
|
|
43
|
+
seasons = {}
|
44
|
+
## generate lookup table by season
|
45
|
+
recs.each do |text,slug|
|
86
46
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
end
|
47
|
+
##
|
48
|
+
## fix upstream?? - allow multi-year seasons? why? why not?
|
49
|
+
## for now ignore special case and collect more real-world cases/samples
|
50
|
+
## if possible
|
51
|
+
## ["2019-2021 Playoffs", "regionalliga-bayern-2019-2021-playoffs"],
|
52
|
+
## ["2019-2021", "regionalliga-bayern-2019-2021"],
|
53
|
+
##
|
95
54
|
|
96
55
|
|
56
|
+
season, stage = text.split( ' ', 2 )
|
97
57
|
|
98
|
-
|
99
|
-
|
100
|
-
## e.g. {season} or {start_year} becomes {}
|
58
|
+
## todo/fix: add a waring here and auto log to logs.txt!!!!
|
59
|
+
next if season == '2019-2021'
|
101
60
|
|
102
|
-
|
103
|
-
[^}]+
|
104
|
-
}/x
|
61
|
+
season = Season.parse( season )
|
105
62
|
|
63
|
+
seasons[ season.key ] ||= []
|
64
|
+
seasons[ season.key] << [slug, stage]
|
65
|
+
end
|
66
|
+
seasons
|
67
|
+
end
|
68
|
+
@seasons
|
69
|
+
end
|
106
70
|
|
107
|
-
def self.norm_slug( slug )
|
108
|
-
## assume convenience fallback - append regular season
|
109
|
-
slug.index( '{' ) ? slug : "#{slug}-{season}"
|
110
|
-
end
|
111
71
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
data[:pages].each do |slug|
|
120
|
-
slug = Worldfootball.norm_slug( slug )
|
121
|
-
pages[ slug.sub( PAGE_VAR_RE, '{}') ] = { league: key, slug: slug }
|
122
|
-
end
|
123
|
-
## elsif data[:pages].nil?
|
124
|
-
## todo/fix: missing pages!!!
|
125
|
-
else ## assume hash
|
126
|
-
## add stage to pages too - why? why not?
|
127
|
-
data[:pages].each do |slug, stage|
|
128
|
-
slug = Worldfootball.norm_slug( slug )
|
129
|
-
pages[ slug.sub( PAGE_VAR_RE, '{}') ] = { league: key, slug: slug, stage: stage }
|
130
|
-
end
|
131
|
-
end
|
132
|
-
pages
|
133
|
-
end
|
134
|
-
|
135
|
-
# e.g. 2000 or 2000-2001
|
136
|
-
SEASON_RE = /[0-9]{4}
|
137
|
-
(?:
|
138
|
-
-[0-9]{4}
|
139
|
-
)?
|
140
|
-
/x
|
141
|
-
|
142
|
-
|
143
|
-
def self.find_page!( slug )
|
144
|
-
page = find_page( slug )
|
145
|
-
if page.nil?
|
146
|
-
puts "!! ERROR: no mapping for page >#{slug}< found; sorry"
|
147
|
-
|
148
|
-
season_str = nil
|
149
|
-
norm = slug.sub( SEASON_RE ) do |match| ## replace season with var placeholder {}
|
150
|
-
season_str = match ## keep reference to season str
|
151
|
-
'{}' ## replace with {}
|
152
|
-
end
|
153
|
-
|
154
|
-
puts " season: >#{season_str}<"
|
155
|
-
puts " slug (norm): >#{norm}<"
|
156
|
-
puts
|
157
|
-
## pp PAGES
|
158
|
-
exit 1
|
72
|
+
def pages!( season: )
|
73
|
+
pages = pages( season: season )
|
74
|
+
if pages.nil?
|
75
|
+
puts "!! ERROR - no season #{season} found for #{key}; seasons incl:"
|
76
|
+
puts seasons.keys.join( ', ' )
|
77
|
+
puts " #{seasons.keys.size} season(s)"
|
78
|
+
exit 1
|
159
79
|
end
|
160
|
-
|
80
|
+
pages
|
161
81
|
end
|
162
82
|
|
83
|
+
def pages( season: )
|
84
|
+
### lookup league pages/slugs by season
|
85
|
+
season = Season( season )
|
86
|
+
|
87
|
+
## note: assume reverse chronological order
|
88
|
+
## reverse here
|
89
|
+
## e.g.
|
90
|
+
## [["aut-bundesliga-2023-2024-qualifikationsgruppe", "Qualifikationsgruppe"],
|
91
|
+
## ["aut-bundesliga-2023-2024-playoff", "Playoff"],
|
92
|
+
## ["aut-bundesliga-2023-2024-meistergruppe", "Meistergruppe"],
|
93
|
+
## ["aut-bundesliga-2023-2024", nil]]
|
94
|
+
## =>
|
95
|
+
## [["aut-bundesliga-2023-2024", nil],
|
96
|
+
## ["aut-bundesliga-2023-2024-meistergruppe", "Meistergruppe"],
|
97
|
+
## ["aut-bundesliga-2023-2024-playoff", "Playoff"],
|
98
|
+
## ["aut-bundesliga-2023-2024-qualifikationsgruppe", "Qualifikationsgruppe"]]
|
99
|
+
recs = seasons[season.key]
|
100
|
+
recs ? recs.reverse : nil
|
101
|
+
end
|
102
|
+
end # class LeagueItem
|
163
103
|
|
164
104
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
105
|
+
def add( recs )
|
106
|
+
recs.each do |rec|
|
107
|
+
@table[ rec['key'] ] = LeagueItem.new( key: rec['key'],
|
108
|
+
slug: rec['slug'] )
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
def [](key) @table[key.to_s.downcase]; end
|
113
|
+
def keys() @table.keys; end
|
114
|
+
def size() @table.size; end
|
115
|
+
end # class LeagueConfig
|
172
116
|
|
173
|
-
if season_str.nil?
|
174
|
-
puts "!! ERROR: no season found in page slug >#{slug}<; sorry"
|
175
|
-
exit 1
|
176
|
-
end
|
177
117
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
118
|
+
LEAGUES = LeagueConfig.new
|
119
|
+
['leagues_europe',
|
120
|
+
'leagues_asia',].each do |name|
|
121
|
+
recs = read_csv( "#{Worldfootball.root}/config/#{name}.csv" )
|
122
|
+
pp recs
|
123
|
+
puts " #{recs.size} league(s) in #{name}"
|
124
|
+
LEAGUES.add( recs )
|
125
|
+
end
|
126
|
+
|
127
|
+
|
128
|
+
###########
|
129
|
+
# (strict) lookup convenience helpers with error reporting
|
130
|
+
# AND abort if no lookup found
|
131
|
+
def self.find_league!( league_code )
|
132
|
+
league = LEAGUES[ league_code ]
|
133
|
+
if league.nil?
|
134
|
+
puts "!! ERROR - no config found for #{league_code}; leagues incl:"
|
135
|
+
puts LEAGUES.keys.join( ', ' )
|
136
|
+
puts " #{LEAGUES.size} leagues(s)"
|
137
|
+
exit 1
|
197
138
|
end
|
139
|
+
league
|
140
|
+
end
|
198
141
|
|
142
|
+
def self.find_league_pages!( league:, season: )
|
143
|
+
league = find_league!( league )
|
144
|
+
pages = league.pages!( season: season )
|
145
|
+
pages
|
146
|
+
end
|
147
|
+
end # module Worldfootball
|
199
148
|
|
200
|
-
end # module Worldfootball
|
data/lib/worldfootball/mods.rb
CHANGED
@@ -16,6 +16,9 @@ end
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
+
MODS = {}
|
20
|
+
|
21
|
+
=begin
|
19
22
|
MODS = {
|
20
23
|
'at' => {
|
21
24
|
## AT 1
|
@@ -42,7 +45,7 @@ MODS = {
|
|
42
45
|
'Wellington Phoenix (R)' => 'Wellington Phoenix Reserves',
|
43
46
|
},
|
44
47
|
}
|
45
|
-
|
48
|
+
=end
|
46
49
|
|
47
50
|
|
48
51
|
## fix/patch known score format errors in at/de cups
|
@@ -65,7 +68,11 @@ SCORE_ERRORS = {
|
|
65
68
|
## 2010/11
|
66
69
|
'2010-11-24' => [ 'Ergotelis', 'Olympiakos Piräus', ['0-2 (0-0, 0-0, 0-0)', '0-2 (0-0)']],
|
67
70
|
'2010-11-28' => [ 'Panserraikos', 'Aris Saloniki', ['1-0 (1-0, 0-0, 0-0)', '1-0 (1-0)']],
|
68
|
-
}
|
71
|
+
},
|
72
|
+
'at.cup' => {
|
73
|
+
## 2023/24
|
74
|
+
'2023-07-22' => [ 'SV Leobendorf', 'SV Horn', ['3-2 (2-0, 2-2, 3-2) n.V.', '3-2 (2-0, 2-2) n.V.']],
|
75
|
+
},
|
69
76
|
}
|
70
77
|
|
71
78
|
|
data/lib/worldfootball/page.rb
CHANGED
@@ -102,5 +102,14 @@ def assert( cond, msg )
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
+
|
106
|
+
def log( msg ) ### append to log
|
107
|
+
File.open( './logs.txt', 'a:utf-8' ) do |f|
|
108
|
+
f.write( msg )
|
109
|
+
f.write( "\n" )
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
|
105
114
|
end # class Page
|
106
115
|
end # module Worldfootball
|
@@ -24,6 +24,8 @@ class Schedule < Page ## note: use nested class for now - why? why not?
|
|
24
24
|
# puts table.class.name #=> Nokogiri::XML::Element
|
25
25
|
# puts table.text
|
26
26
|
|
27
|
+
assert( table, 'no table.standard_tabelle found in schedule page!!')
|
28
|
+
|
27
29
|
trs = table.css( 'tr' )
|
28
30
|
# puts trs.size
|
29
31
|
i = 0
|
@@ -34,6 +36,9 @@ class Schedule < Page ## note: use nested class for now - why? why not?
|
|
34
36
|
rows = []
|
35
37
|
|
36
38
|
|
39
|
+
|
40
|
+
trs.each do |tr|
|
41
|
+
|
37
42
|
## ghost trs? what for? see for an example in bra
|
38
43
|
## check for style display:none - why? why not?
|
39
44
|
##
|
@@ -45,10 +50,15 @@ class Schedule < Page ## note: use nested class for now - why? why not?
|
|
45
50
|
## </td>
|
46
51
|
## <td colspan="2"></td>
|
47
52
|
## </tr>
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
53
|
+
##
|
54
|
+
# <tr class="e2-parent" data-liga_id="530" data-gs_match_id="10259222"
|
55
|
+
# style="display:none;">
|
56
|
+
## <td colspan="2"></td>
|
57
|
+
## <td colspan="3">
|
58
|
+
## <span class="e2" data-liga_id="530" data-gs_match_id="10259222"></span>
|
59
|
+
## </td>
|
60
|
+
## <td colspan="2"></td>
|
61
|
+
## </tr>
|
52
62
|
if tr['style'] && tr['style'].index( 'display') &&
|
53
63
|
tr['style'].index( 'none')
|
54
64
|
puts "!! WARN: skipping ghost line >#{tr.text.strip}<"
|
@@ -58,6 +68,15 @@ class Schedule < Page ## note: use nested class for now - why? why not?
|
|
58
68
|
|
59
69
|
i += 1
|
60
70
|
|
71
|
+
## puts "[debug] row #{i} >#{tr.text.strip}<"
|
72
|
+
|
73
|
+
### note - assume for now match lines use tds
|
74
|
+
## and round lines use ths (NOT tds)!!
|
75
|
+
## e.g. <th colspan="7">8. Spieltag</th>
|
76
|
+
|
77
|
+
ths = tr.css( 'th' )
|
78
|
+
tds = tr.css( 'td' )
|
79
|
+
|
61
80
|
if tr.text.strip =~ /Spieltag/ ||
|
62
81
|
tr.text.strip =~ /[1-9]\.[ ]Runde|
|
63
82
|
Qual\.[ ][1-9]\.[ ]Runde| # see EL or CL Quali
|
@@ -68,8 +87,26 @@ class Schedule < Page ## note: use nested class for now - why? why not?
|
|
68
87
|
Halbfinale|
|
69
88
|
Finale|
|
70
89
|
Gruppe[ ][A-Z]| # see CL
|
71
|
-
|
90
|
+
Gruppe[ ][1-9]| # see slv-primera-division-2020-2021-clausura_3
|
91
|
+
Playoffs| # see EL Quali
|
92
|
+
Entscheidungsspiel| # see Serie A 2022-23 Entscheidung Abstieg
|
93
|
+
Spiele| # see Serie A 1960-61 Relegation
|
94
|
+
3\.[ ]Platz| # see bra-serie-a-2000-yellow-module-playoffs
|
95
|
+
Spiel[ ]um[ ]Platz[ ]3| # see campeonato-2009-cuadrangulares-deportivo-cuenca-cs-emelec
|
96
|
+
Relegation| # see egy-premiership-2013-2014-abstiegsplayoff
|
97
|
+
Copa[ ]Libertadores| # see ecu-campeonato-2012-segunda-etapa-playoffs
|
98
|
+
Copa[ ]Sudamericana| # see campeonato-2012-liguilla-final-playoffs-cs-emelec-ldu-quito
|
99
|
+
Repechaje| # see nca-liga-primera-2023-2024-clausura-playoffs
|
100
|
+
Final[ ]de[ ]Grupos| # see hon-liga-nacional-2020-2021-clausura-playoffs
|
101
|
+
Gran[ ]Final| # see liga-nacional-2020-2021-apertura-playoffs-finale-olimpia-motagua
|
102
|
+
Finalrunde| # see hon-liga-nacional-2019-2020-apertura-pentagonal
|
103
|
+
Zona[ ]A| # see gua-liga-nacional-2020-2021-clausura
|
104
|
+
Zona[ ]B| # see liga-nacional-2020-2021-clausura-zona-a-comunicaciones-deportivo-malacateco
|
105
|
+
Interzone| # see liga-nacional-2020-2021-clausura-zona-b-achuapa-sanarate
|
106
|
+
Final[ ]Segunda[ ]Ronda| # see crc-primera-division-2018-2019-apertura-playoffs
|
107
|
+
Quadrangular # see crc-primera-division-2016-2017-verano-playoffs
|
72
108
|
/x
|
109
|
+
|
73
110
|
puts
|
74
111
|
print '[%03d] ' % i
|
75
112
|
## print squish( tr.text )
|
@@ -77,8 +114,14 @@ class Schedule < Page ## note: use nested class for now - why? why not?
|
|
77
114
|
print "\n"
|
78
115
|
|
79
116
|
last_round = tr.text.strip
|
117
|
+
elsif ths.count > 0 &&
|
118
|
+
tds.count == 0
|
119
|
+
## check for round NOT yet configured!!!
|
120
|
+
puts "!! WARN: found unregistered round line >#{tr.text.strip}<"
|
121
|
+
log( "!! WARN: found unregistered round line >#{tr.text.strip}< in page #{title}" )
|
122
|
+
|
123
|
+
last_round = tr.text.strip
|
80
124
|
else ## assume table row (tr) is match line
|
81
|
-
tds = tr.css( 'td' )
|
82
125
|
|
83
126
|
date_str = squish( tds[0].text )
|
84
127
|
time_str = squish( tds[1].text )
|
@@ -164,12 +207,21 @@ class Schedule < Page ## note: use nested class for now - why? why not?
|
|
164
207
|
score_str = score_str.gsub( ':', '-' )
|
165
208
|
|
166
209
|
## convert date from 25.10.2019 to 2019-25-10
|
167
|
-
|
210
|
+
|
211
|
+
## special case for '00.00.0000'
|
212
|
+
## CANNOT parse
|
213
|
+
## use empty date - why? why not?
|
214
|
+
|
215
|
+
date = if date_str == '00.00.0000'
|
216
|
+
nil
|
217
|
+
else
|
218
|
+
Date.strptime( date_str, '%d.%m.%Y' )
|
219
|
+
end
|
168
220
|
|
169
221
|
## note: keep structure flat for now
|
170
222
|
## (AND not nested e.g. team:{text:,ref:}) - why? why not?
|
171
223
|
rows << { round: last_round,
|
172
|
-
date: date.strftime( '%Y-%m-%d' ),
|
224
|
+
date: date ? date.strftime( '%Y-%m-%d' ) : '',
|
173
225
|
time: time_str,
|
174
226
|
team1: team1_str,
|
175
227
|
team1_ref: team1_ref,
|
data/lib/worldfootball/vacuum.rb
CHANGED
@@ -6,13 +6,15 @@ MAX_HEADERS = [
|
|
6
6
|
'Round',
|
7
7
|
'Date',
|
8
8
|
'Time',
|
9
|
+
'Timezone',
|
9
10
|
'Team 1',
|
10
11
|
'FT',
|
11
12
|
'HT',
|
12
13
|
'Team 2',
|
13
14
|
'ET',
|
14
15
|
'P',
|
15
|
-
'Comments'
|
16
|
+
'Comments', ## e.g. awarded, cancelled/canceled, etc.
|
17
|
+
'UTC']
|
16
18
|
|
17
19
|
MIN_HEADERS = [ ## always keep even if all empty
|
18
20
|
'Date',
|
data/lib/worldfootball.rb
CHANGED
@@ -1,34 +1,30 @@
|
|
1
1
|
## 3rd party (our own)
|
2
|
-
require '
|
3
|
-
require 'webget'
|
4
|
-
|
5
|
-
require 'cocos'
|
6
|
-
|
7
|
-
## 3rd party
|
2
|
+
require 'football/timezones' ## note - pulls in season/formats, cocos & tzinfo
|
3
|
+
require 'webget' ## incl. webget, webcache, webclient, etc.
|
8
4
|
require 'nokogiri'
|
9
5
|
|
10
6
|
|
11
|
-
|
12
7
|
###
|
13
8
|
# our own code
|
14
9
|
require_relative 'worldfootball/version'
|
15
10
|
require_relative 'worldfootball/leagues'
|
11
|
+
|
12
|
+
require_relative 'worldfootball/config' ## rename to setup/timezones/layouts or such?
|
16
13
|
require_relative 'worldfootball/download'
|
17
14
|
require_relative 'worldfootball/page'
|
18
15
|
require_relative 'worldfootball/page_schedule'
|
19
16
|
require_relative 'worldfootball/page_report'
|
17
|
+
require_relative 'worldfootball/cache'
|
20
18
|
|
21
19
|
|
22
20
|
require_relative 'worldfootball/mods'
|
23
21
|
require_relative 'worldfootball/vacuum'
|
24
22
|
require_relative 'worldfootball/build'
|
23
|
+
require_relative 'worldfootball/build-parse_score'
|
25
24
|
require_relative 'worldfootball/convert'
|
26
25
|
require_relative 'worldfootball/convert_reports'
|
27
26
|
|
28
27
|
|
29
|
-
require_relative 'worldfootball/generator'
|
30
|
-
|
31
|
-
|
32
28
|
|
33
29
|
module Worldfootball
|
34
30
|
|
@@ -55,12 +51,6 @@ end # module Worldfootball
|
|
55
51
|
|
56
52
|
|
57
53
|
|
58
|
-
### for processing tool
|
59
|
-
## (auto-)add sportdb/writer (pulls in sportdb/catalogs and gitti)
|
60
|
-
# require 'sportdb/writers'
|
61
|
-
|
62
|
-
|
63
|
-
|
64
54
|
|
65
55
|
puts Worldfootball.banner ## say hello
|
66
56
|
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: worldfootball
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: football-timezones
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: cocos
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rdoc
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,24 +102,17 @@ files:
|
|
116
102
|
- README.md
|
117
103
|
- Rakefile
|
118
104
|
- bin/wfb
|
105
|
+
- config/leagues_asia.csv
|
106
|
+
- config/leagues_europe.csv
|
119
107
|
- lib/worldfootball.rb
|
108
|
+
- lib/worldfootball/build-parse_score.rb
|
120
109
|
- lib/worldfootball/build.rb
|
110
|
+
- lib/worldfootball/cache.rb
|
111
|
+
- lib/worldfootball/config.rb
|
121
112
|
- lib/worldfootball/convert.rb
|
122
113
|
- lib/worldfootball/convert_reports.rb
|
123
114
|
- lib/worldfootball/download.rb
|
124
|
-
- lib/worldfootball/generator.rb
|
125
115
|
- lib/worldfootball/leagues.rb
|
126
|
-
- lib/worldfootball/leagues/asia.rb
|
127
|
-
- lib/worldfootball/leagues/europe--british_isles.rb
|
128
|
-
- lib/worldfootball/leagues/europe--central.rb
|
129
|
-
- lib/worldfootball/leagues/europe--eastern.rb
|
130
|
-
- lib/worldfootball/leagues/europe--northern.rb
|
131
|
-
- lib/worldfootball/leagues/europe--southern.rb
|
132
|
-
- lib/worldfootball/leagues/europe--western.rb
|
133
|
-
- lib/worldfootball/leagues/europe.rb
|
134
|
-
- lib/worldfootball/leagues/north_america.rb
|
135
|
-
- lib/worldfootball/leagues/pacific.rb
|
136
|
-
- lib/worldfootball/leagues/south_america.rb
|
137
116
|
- lib/worldfootball/mods.rb
|
138
117
|
- lib/worldfootball/page.rb
|
139
118
|
- lib/worldfootball/page_report.rb
|
@@ -154,7 +133,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
154
133
|
requirements:
|
155
134
|
- - ">="
|
156
135
|
- !ruby/object:Gem::Version
|
157
|
-
version:
|
136
|
+
version: 3.1.0
|
158
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
138
|
requirements:
|
160
139
|
- - ">="
|