-
Notifications
You must be signed in to change notification settings - Fork 0
/
boxscore.go
157 lines (145 loc) · 6 KB
/
boxscore.go
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
package gamedayapi
import "encoding/xml"
// Boxscore is the representation of the boxscore.xml file.
type Boxscore struct {
XMLName xml.Name `xml:"boxscore"`
AwayFName string `xml:"away_fname,attr"`
AwayID string `xml:"away_id,attr"`
AwayLoss string `xml:"away_loss,attr"`
AwaySName string `xml:"away_sname,attr"`
AwayTeamCode string `xml:"away_team_code,attr"`
AwayWins string `xml:"away_wins,attr"`
Date string `xml:"date,attr"`
GameID string `xml:"game_id,attr"`
GamePk string `xml:"game_pk,attr"`
HomeFName string `xml:"home_fname,attr"`
HomeID string `xml:"home_id,attr"`
HomeLoss string `xml:"home_loss,attr"`
HomeSName string `xml:"home_sname,attr"`
HomeSportCode string `xml:"home_sport_code,attr"`
HomeTeamCode string `xml:"home_team_code,attr"`
HomeWins string `xml:"home_wins,attr"`
StatusInd string `xml:"status_ind,attr"`
VenueID string `xml:"venue_id,attr"`
VenueName string `xml:"venue_name,attr"`
Linescore Linescore `xml:"linescore"`
Batting []Batting `xml:"batting"`
Pitching []Pitching `xml:"pitching"`
}
// Linescore represents the linescore under the boxscore, not the individual linescore.xml file.
type Linescore struct {
XMLName xml.Name `xml:"linescore"`
AwayTeamRuns string `xml:"away_team_runs,attr"`
HomeTeamRuns string `xml:"home_team_runs,attr"`
InningLineScores []InningLineScore `xml:"inning_line_score"`
}
// InningLineScore represents the individual innings in the linescore.
type InningLineScore struct {
XMLName xml.Name `xml:"inning_line_score"`
Away string `xml:"away,attr"`
Home string `xml:"home,attr"`
Inning string `xml:"inning,attr"`
}
// Batting represents the batting elements in the boxscore.
type Batting struct {
XMLName xml.Name `xml:"batting"`
TeamFlag string `xml:"team_flag,attr"`
AB string `xml:"ab,attr"`
R string `xml:"r,attr"`
H string `xml:"h,attr"`
D string `xml:"d,attr"`
T string `xml:"t,attr"`
HR string `xml:"hr,attr"`
RBI string `xml:"rbi,attr"`
BB string `xml:"bb,attr"`
PO string `xml:"po,attr"`
DA string `xml:"da,attr"`
SO string `xml:"so,attr"`
LOB string `xml:"lob,attr"`
AVG string `xml:"avg,attr"`
Batters []Batter `xml:"batter"`
}
// Batter represents the batter elements in the boxscore.
type Batter struct {
XMLName xml.Name `xml:"batter"`
ID string `xml:"id,attr"`
Name string `xml:"name,attr"`
NameDisplayFirstLast string `xml:"name_display_first_last,attr"`
Pos string `xml:"pos,attr"`
BO string `xml:"bo,attr"`
AB string `xml:"ab,attr"`
PO string `xml:"po,attr"`
R string `xml:"r,attr"`
A string `xml:"a,attr"`
BB string `xml:"bb,attr"`
SAC string `xml:"sac,attr"`
T string `xml:"t,attr"`
SF string `xml:"sf,attr"`
H string `xml:"h,attr"`
E string `xml:"e,attr"`
D string `xml:"d,attr"`
HBP string `xml:"hbp,attr"`
SO string `xml:"so,attr"`
HR string `xml:"hr,attr"`
RBI string `xml:"rbi,attr"`
LOB string `xml:"lob,attr"`
FLDG string `xml:"fldg,attr"`
SB string `xml:"sb,attr"`
CS string `xml:"cs,attr"`
SHR string `xml:"s_hr,attr"`
SRBI string `xml:"s_rbi,attr"`
SH string `xml:"s_h,attr"`
SBB string `xml:"s_bb,attr"`
SR string `xml:"s_r,attr"`
SSO string `xml:"s_so,attr"`
AVG string `xml:"savg,attr"`
GO string `xml:"go,attr"`
AO string `xml:"ao,attr"`
}
// Pitching represents the pitching elements in the boxscore.
type Pitching struct {
XMLName xml.Name `xml:"pitching"`
TeamFlag string `xml:"team_flag,attr"`
Out string `xml:"out,attr"`
H string `xml:"h,attr"`
R string `xml:"r,attr"`
ER string `xml:"er,attr"`
BB string `xml:"bb,attr"`
SO string `xml:"so,attr"`
HR string `xml:"hr,attr"`
BF string `xml:"bf,attr"`
ERA string `xml:"era,attr"`
Pitchers []Pitcher `xml:"pitcher"`
}
// Pitcher represents the pitcher elements in the boxscore.
type Pitcher struct {
XMLName xml.Name `xml:"pitcher"`
ID string `xml:"id,attr"`
Name string `xml:"name,attr"`
NameDisplayFirstLast string `xml:"name_display_first_last,attr"`
Pos string `xml:"pos,attr"`
Out string `xml:"out,attr"`
BF string `xml:"bf,attr"`
ER string `xml:"er,attr"`
R string `xml:"r,attr"`
H string `xml:"h,attr"`
SO string `xml:"so,attr"`
HR string `xml:"hr,attr"`
BB string `xml:"bb,attr"`
NP string `xml:"np,attr"`
S string `xml:"s,attr"`
W string `xml:"w,attr"`
L string `xml:"l,attr"`
SV string `xml:"sv,attr"`
BS string `xml:"bs,attr"`
HLD string `xml:"hld,attr"`
SIP string `xml:"s_ip,attr"`
SH string `xml:"s_h,attr"`
SR string `xml:"s_r,attr"`
SER string `xml:"s_er,attr"`
SBB string `xml:"s_bb,attr"`
SSO string `xml:"s_so,attr"`
ERA string `xml:"era,attr"`
Win string `xml:"win,attr"`
Note string `xml:"note,attr"`
}