Class: GamedayFetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/gameday_fetcher.rb

Overview

This class is responsible for retrieving the Gameday files. It uses either a remote or a local fetcher to get the files from a remote server or the local file system.

The files that can be fetched using this class:

THESE FILES ARE ASSOCIATED WITH A SPECIFIC DATE

epg.xml
master_scoreboard.xml
media/highlights.xml

HTML PAGES THAT CAN BE RETRIEVED

games page => this page lists all games for the selected date
batters page => this page lists all batter files for the selected game
pitchers page => this page lists all pitcher files for the selected game

FILES THAT ARE ASSOCIATED WITH A SPECIFIC GAME IDENTIFIED BY A GID ##############

bench.xml
benchO.xml
boxscore.xml
emailSource.xml
eventLog.xml
game.xml
game_events.xml
gamecenter.xml
gameday_Syn.xml
linescore.xml
miniscoreboard.xml
players.xml
plays.xml

batters/(pid).xml
pitchers/(pid).xml

inning/inning_X.xml 
inning/inning_Scores.xml
inning/inning_hit.xml

onbase/linescore.xml
onbase/plays.xml

media/highlights.xml
media/mobile.xml

notifications/notifications_X.xml where X is an inning number
notifications/notifications_full.xml

Class Method Summary collapse

Class Method Details

.fetch_batter(gid, pid) ⇒ Object

Fetches the batters/(pid).xml file



169
170
171
# File 'lib/gameday_fetcher.rb', line 169

def self.fetch_batter(gid, pid)
  GamedayUtil.fetcher.fetch_batter(gid, pid)
end

.fetch_batters_page(gid) ⇒ Object

Fetches the HTML page that lists all games for the specified date



204
205
206
# File 'lib/gameday_fetcher.rb', line 204

def self.fetch_batters_page(gid)
  GamedayUtil.fetcher.fetch_batters_page(gid)
end

.fetch_bench(gid) ⇒ Object



84
85
86
# File 'lib/gameday_fetcher.rb', line 84

def self.fetch_bench(gid)
  GamedayUtil.fetcher.fetch_bench(gid)
end

.fetch_bencho(gid) ⇒ Object



91
92
93
# File 'lib/gameday_fetcher.rb', line 91

def self.fetch_bencho(gid)
  GamedayUtil.fetcher.fetch_bencho(gid)
end

.fetch_boxscore(gid) ⇒ Object

Fetches the boxscore.xml file and returns its contents Sample URL: gd2.mlb.com/components/game/mlb/year_2009/month_05/day_08/gid_2009_05_08_detmlb_clemlb_1/boxscore.xml



98
99
100
# File 'lib/gameday_fetcher.rb', line 98

def self.fetch_boxscore(gid)
  GamedayUtil.fetcher.fetch_boxscore(gid)
end

.fetch_day_highlights(year, month, day) ⇒ Object



77
78
79
# File 'lib/gameday_fetcher.rb', line 77

def self.fetch_day_highlights(year, month, day)
  GamedayUtil.fetcher.fetch_day_highlights(year, month, day)
end

.fetch_emailsource(gid) ⇒ Object



105
106
107
# File 'lib/gameday_fetcher.rb', line 105

def self.fetch_emailsource(gid)
  GamedayUtil.fetcher.fetch_emailsource(gid) 
end

.fetch_epg(year, month, day) ⇒ Object



65
66
67
# File 'lib/gameday_fetcher.rb', line 65

def self.fetch_epg(year, month, day)
  GamedayUtil.fetcher.fetch_epg(year, month, day)
end

.fetch_eventlog(gid) ⇒ Object

Fetches the eventLog.xml file and returns its contents Sample URL: gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_flomlb_wasmlb_1/eventLog.xml



112
113
114
# File 'lib/gameday_fetcher.rb', line 112

def self.fetch_eventlog(gid)
  GamedayUtil.fetcher.fetch_eventlog(gid)
end

.fetch_game_events(gid) ⇒ Object



123
124
125
# File 'lib/gameday_fetcher.rb', line 123

def self.fetch_game_events(gid)
  GamedayUtil.fetcher.fetch_game_events(gid)
end

.fetch_game_xml(gid) ⇒ Object

Fetches the game.xml file and returns its contents



118
119
120
# File 'lib/gameday_fetcher.rb', line 118

def self.fetch_game_xml(gid)
  GamedayUtil.fetcher.fetch_game_xml(gid)
end

.fetch_gamecenter_xml(gid) ⇒ Object

Fetches the gamecenter.xml file and returns its contents



129
130
131
# File 'lib/gameday_fetcher.rb', line 129

def self.fetch_gamecenter_xml(gid)
  GamedayUtil.fetcher.fetch_gamecenter_xml(gid)
end

.fetch_gamedaysyn(gid) ⇒ Object



136
137
138
# File 'lib/gameday_fetcher.rb', line 136

def self.fetch_gamedaysyn(gid)
  GamedayUtil.fetcher.fetch_gamedaysyn(gid)  
end

.fetch_games_page(year, month, day) ⇒ Object

Fetches the HTML page that lists all games for the specified date



198
199
200
# File 'lib/gameday_fetcher.rb', line 198

def self.fetch_games_page(year, month, day)
  GamedayUtil.fetcher.fetch_games_page(year, month, day)
end

.fetch_inning_hit(gid) ⇒ Object

inning/inning_hit.xml



192
193
194
# File 'lib/gameday_fetcher.rb', line 192

def self.fetch_inning_hit(gid)
  GamedayUtil.fetcher.fetch_inning_hit(gid)
end

.fetch_inning_scores(gid) ⇒ Object

inning/inning_Score.xml



186
187
188
# File 'lib/gameday_fetcher.rb', line 186

def self.fetch_inning_scores(gid) 
  GamedayUtil.fetcher.fetch_inning_scores(gid)
end

.fetch_inningx(gid, inning_num) ⇒ Object

inning/inning_X.xml



180
181
182
# File 'lib/gameday_fetcher.rb', line 180

def self.fetch_inningx(gid, inning_num)
  GamedayUtil.fetcher.fetch_inningx(gid, inning_num)
end

.fetch_linescore(gid) ⇒ Object



143
144
145
# File 'lib/gameday_fetcher.rb', line 143

def self.fetch_linescore(gid)
  GamedayUtil.fetcher.fetch_linescore(gid)
end

.fetch_media_highlights(gid) ⇒ Object



215
216
217
# File 'lib/gameday_fetcher.rb', line 215

def self.fetch_media_highlights(gid)
  GamedayUtil.fetcher.fetch_media_highlights(gid)
end

.fetch_media_mobile(gid) ⇒ Object



220
221
222
# File 'lib/gameday_fetcher.rb', line 220

def self.fetch_media_mobile(gid)
  GamedayUtil.fetcher.fetch_media_mobile(gid)
end

.fetch_miniscoreboard(gid) ⇒ Object



150
151
152
# File 'lib/gameday_fetcher.rb', line 150

def self.fetch_miniscoreboard(gid)
  GamedayUtil.fetcher.fetch_miniscoreboard(gid)   
end

.fetch_notifications_full(gid) ⇒ Object



240
241
242
# File 'lib/gameday_fetcher.rb', line 240

def self.fetch_notifications_full(gid)
  GamedayUtil.fetcher.fetch_notifications_full(gid)
end

.fetch_notifications_inning(gid, inning) ⇒ Object



235
236
237
# File 'lib/gameday_fetcher.rb', line 235

def self.fetch_notifications_inning(gid, inning)
  GamedayUtil.fetcher.fetch_notifications_inning(gid, inning)
end

.fetch_onbase_linescore(gid) ⇒ Object



225
226
227
# File 'lib/gameday_fetcher.rb', line 225

def self.fetch_onbase_linescore(gid)
  GamedayUtil.fetcher.fetch_onbase_linescore(gid)
end

.fetch_onbase_plays(gid) ⇒ Object



230
231
232
# File 'lib/gameday_fetcher.rb', line 230

def self.fetch_onbase_plays(gid)
  GamedayUtil.fetcher.fetch_onbase_plays(gid)
end

.fetch_pitcher(gid, pid) ⇒ Object

Fetches the pitchers/(pid).xml file



175
176
177
# File 'lib/gameday_fetcher.rb', line 175

def self.fetch_pitcher(gid, pid)
  GamedayUtil.fetcher.fetch_pitcher(gid, pid)
end

.fetch_pitchers_page(gid) ⇒ Object

Fetches the HTML page that lists all games for the specified date



210
211
212
# File 'lib/gameday_fetcher.rb', line 210

def self.fetch_pitchers_page(gid)
  GamedayUtil.fetcher.fetch_pitchers_page(gid)
end

.fetch_players(gid) ⇒ Object

Fetches the players.xml file and returns its contents



156
157
158
# File 'lib/gameday_fetcher.rb', line 156

def self.fetch_players(gid)
  GamedayUtil.fetcher.fetch_players(gid)
end

.fetch_plays(gid) ⇒ Object



163
164
165
# File 'lib/gameday_fetcher.rb', line 163

def self.fetch_plays(gid)
  GamedayUtil.fetcher.fetch_plays(gid)
end

.fetch_scoreboard(year, month, day) ⇒ Object



72
73
74
# File 'lib/gameday_fetcher.rb', line 72

def self.fetch_scoreboard(year, month, day)
  GamedayUtil.fetcher.fetch_scoreboard(year, month, day)
end