Best way to automate scoring for offline league - Fantasy Baseball Cafe 2014 Fantasy Baseball Cafe
100% Deposit Bonus for Cafe Members!

Return to Commissioner's Corner

Best way to automate scoring for offline league

Moderator: Baseball Moderators

Best way to automate scoring for offline league

Postby jbrady3324 » Tue Apr 06, 2010 12:45 pm

Hopefully someone can point me in the right direction. 5 people (including myself) have been doing an offline keeper league for almost 10 years now and we have been manually keeping track of the scores each day. Obviously, this is hard. I am looking for a way to automate the process either via a website or excel or whatever. I've thought about writing a program to pull stats of a website but that would be last resort giving the amount of time it would take to develop. Below is our scoring system. Thanks!

Scoring System
Everyone- 3-Hit, 1-RBI, 1-Run, -1-Out
1- 2-Run, 2-BB, 2-SB, -2-CS
2- 1-Run, 1-BB, 1-SB, -1-CS
3- 2-Hit, 2-RBI, 1-Run
4- 2-HR, 2-RBI, 1-BB
5- 1-HR, 1-RBI
6- 1-RBI, 1-Run
7- 1- RBI
8- 1-Run
9- None

Starting Pitchers
10- Win
5- Complete Game
IP-Earned Runs
-5-Loss
1- Strikeout
-1- Walk

Closer
7- Save
5- Scoreless Appearence
2- Win
-2- Blown Save, Loss
1- Strikeout
-1- Walk

Middle Relief
5- Scoreless Appearence
5- Win
3- Save
1- Strikeout
-1- Walk
IP-Earned Runs
-2-Loss, Blown Save
jbrady3324
T-Ball Trainer


Posts: 4
Joined: 6 Apr 2010
Home Cafe: Baseball

Re: Best way to automate scoring for offline league

Postby DaSh 1s » Tue Apr 06, 2010 3:23 pm

jbrady3324 wrote:Hopefully someone can point me in the right direction. 5 people (including myself) have been doing an offline keeper league for almost 10 years now and we have been manually keeping track of the scores each day. Obviously, this is hard. I am looking for a way to automate the process either via a website or excel or whatever. I've thought about writing a program to pull stats of a website but that would be last resort giving the amount of time it would take to develop. Below is our scoring system. Thanks!

Scoring System
Everyone- 3-Hit, 1-RBI, 1-Run, -1-Out
1- 2-Run, 2-BB, 2-SB, -2-CS
2- 1-Run, 1-BB, 1-SB, -1-CS
3- 2-Hit, 2-RBI, 1-Run
4- 2-HR, 2-RBI, 1-BB
5- 1-HR, 1-RBI
6- 1-RBI, 1-Run
7- 1- RBI
8- 1-Run
9- None

Starting Pitchers
10- Win
5- Complete Game
IP-Earned Runs
-5-Loss
1- Strikeout
-1- Walk

Closer
7- Save
5- Scoreless Appearence
2- Win
-2- Blown Save, Loss
1- Strikeout
-1- Walk

Middle Relief
5- Scoreless Appearence
5- Win
3- Save
1- Strikeout
-1- Walk
IP-Earned Runs
-2-Loss, Blown Save


Set up 5 bogus email accounts. Set up a yahoo league, with your scoring. Set up the 5 teams with the 5 rosters. let yahoo pull the stats for you. Copy and paste the results to your friends and don't tell them how you are doing it.
B-Chad wrote:Pedroia's LD rate of 20% is reason to believe he'll maintain a higher BA then Cano. It should also be noted he hits more FB's then Cano, which means that even if he posts a lower HR/FB then Cano, he should come in reasonably close to Cano in HR's
DaSh 1s
Major League Manager
Major League Manager

User avatar

Posts: 1893
(Past Year: 1)
Joined: 1 Aug 2007
Home Cafe: Baseball

Re: Best way to automate scoring for offline league

Postby jbrady3324 » Tue Apr 06, 2010 3:30 pm

Issue is that Yahoo does not do this type of scoring based on batting order position. We prefer a free method to do this but are not opposed to paying a small fee to a website that can do this.
jbrady3324
T-Ball Trainer


Posts: 4
Joined: 6 Apr 2010
Home Cafe: Baseball

Re: Best way to automate scoring for offline league

Postby wynams » Thu Jun 17, 2010 4:28 pm

I don't know if it is the best way, but it is free and entirely customizable ...

Use mlb.com's Gameday XML feed to parse out whatever it is you need.
Start here: http://gd2.mlb.com/components/game/mlb/
load year, day/month ... find the game you want, etc.

It took me about 4 hours to write a scoring program for my points league.
wynams
College Coach
College Coach

User avatar

Posts: 200
(Past Year: 9)
Joined: 31 Mar 2006
Home Cafe: Baseball

Re: Best way to automate scoring for offline league

Postby jbrady3324 » Thu Jun 17, 2010 5:11 pm

Thank you! What directory or directories and what files are you reading from?
jbrady3324
T-Ball Trainer


Posts: 4
Joined: 6 Apr 2010
Home Cafe: Baseball

Re: Best way to automate scoring for offline league

Postby wynams » Fri Jun 18, 2010 1:13 am

A sample "boxscore.xml" link is http://gd2.mlb.com/components/game/mlb/ ... xscore.xml

If you can automate generating the day and month, the url above can be built up to the /gid part. You can read in a days scoreboard (http://gd2.mlb.com/components/game/mlb/ ... eboard.xml) to populate the /gid part and beyond. Once you have that ...

For any given game, boxscore.xml should have everything you need. The hardest part is getting HBP and Inherited Runners out of the <game_info> section. If you do not need those for scoring, its a breeze. Some comments from my VB code outlining the format of the boxscore sections ... I only use 2.2, 2.3, 2.4, 2.5 and 2.6 below.


Code: Select all
    '1 = infos
    '2 = boxscore
    '2.1 = linescore
    '2.2 = pitching away
    '<pitching team_flag="away" out="19" h="10" r="2" er="2" bb="1" so="7" hr="1" bf="28" era="2.84">
    '    <pitcher id="119154" name="Millwood" pos="P" out="15" bf="24" er="2" r="2" h="9" so="5" hr="1" bb="1" w="0" l="0" era="3.60"/>
    '    <pitcher id="458006" name="Albers" pos="P" out="4" bf="4" er="0" r="0" h="1" so="2" hr="0" bb="0" w="0" l="0" era="0.00"/>
    '    <pitcher id="349193" name="Ohman" pos="P" out="0" bf="0" er="0" r="0" h="0" so="0" hr="0" bb="0" w="0" l="0" era="0.00"/>
    '</pitching>
    '2.3 = batting home
    '<batting team_flag="home" ab="27" r="2" h="10" d="2" t="0" hr="1" rbi="2" bb="1" po="21" da="4" so="7" lob="11" avg=".370">
    '   <batter id="430583" name="Bartlett" pos="SS" bo="100" ab="4" po="0" r="0" bb="0" a="0" t="0" sf="0" h="2" e="0" d="0" hbp="0" so="1" hr="0" rbi="1" lob="1" fldg=".000" sb="0" avg=".500"/>
    '   <batter id="408307" name="Crawford" pos="LF" bo="200" ab="2" po="1" r="0" bb="1" a="0" t="0" sf="0" h="0" e="0" d="0" hbp="0" so="0" hr="0" rbi="0" lob="2" fldg="1.000" sb="0" avg=".000"/>
    '   <batter id="450314" name="Zobrist" pos="RF" bo="300" ab="3" po="0" r="0" bb="0" a="0" t="0" sf="0" h="2" e="0" d="1" hbp="0" so="0" hr="0" rbi="0" lob="2" fldg=".000" sb="0" avg=".667"/>
    '   <batter id="446334" name="Longoria" pos="3B" bo="400" ab="3" po="1" r="1" bb="0" a="2" t="0" sf="0" h="1" e="0" d="0" hbp="0" so="1" hr="1" rbi="1" lob="1" fldg="1.000" sb="0" avg=".333"/>
    '   <batter id="150289" name="Pena, C" pos="1B" bo="500" ab="3" po="6" r="0" bb="0" a="0" t="0" sf="0" h="1" e="0" d="0" hbp="0" so="1" hr="0" rbi="0" lob="0" fldg="1.000" sb="0" avg=".333"/>
    '   <batter id="425834" name="Upton, B" pos="CF" bo="600" ab="3" po="3" r="0" bb="0" a="0" t="0" sf="0" h="1" e="0" d="0" hbp="0" so="1" hr="0" rbi="0" lob="0" fldg="1.000" sb="0" avg=".333"/>
    '   <batter id="150100" name="Burrell" pos="DH" bo="700" ab="3" po="0" r="1" bb="0" a="0" t="0" sf="0" h="1" e="0" d="1" hbp="0" so="1" hr="0" rbi="0" lob="2" fldg=".000" sb="0" avg=".333"/>
    '   <batter id="446481" name="Rodriguez, S" pos="2B" bo="800" ab="3" po="3" r="0" bb="0" a="2" t="0" sf="0" h="0" e="0" d="0" hbp="0" so="2" hr="0" rbi="0" lob="2" fldg="1.000" sb="0" avg=".000"/>
    '   <batter id="425900" name="Navarro" pos="C" bo="900" ab="3" po="7" r="0" bb="0" a="0" t="0" sf="0" h="2" e="0" d="0" hbp="0" so="0" hr="0" rbi="0" lob="1" fldg="1.000" sb="0" avg=".667"/>
    '   <batter id="448306" name="Shields, J" pos="P" ab="0" po="0" r="0" bb="0" a="0" t="0" sf="0" h="0" e="0" d="0" hbp="0" so="0" hr="0" rbi="0" lob="0" fldg=".000" sb="0" avg=".000"/>
    '   <batter id="329092" name="Choate" pos="P" ab="0" po="0" r="0" bb="0" a="0" t="0" sf="0" h="0" e="0" d="0" hbp="0" so="0" hr="0" rbi="0" lob="0" fldg=".000" sb="0" avg=".000"/>
    '   <text_data>
    '       <b>BATTING</b><br/><b>2B</b>: Zobrist (1, Millwood), Burrell (1, Millwood).<br/><b>HR</b>: Longoria (1, 6th inning off Millwood, 0 on, 0 out).<br/><b>TB</b>: Bartlett 2; Zobrist 3; Longoria 4; Pena, C; Upton, B; Burrell 2; Navarro 2.<br/><b>RBI</b>: Bartlett (1), Longoria (1).<br/><b>2-out RBI</b>: Bartlett.<br/><b>Runners left in scoring position, 2 out</b>: Longoria; Zobrist; Rodriguez, S.<br/><b>GIDP</b>: Burrell.<br/><b>Team RISP</b>: 2-for-9.<br/><b>Team LOB</b>: 6.<br/> <br/><b>FIELDING</b><br/><b>DP</b>: (Longoria-Rodriguez, S-Pena, C).<br/> <br/>
    '   </text_data>
    '</batting>
    '2.4 = pitching home
    '2.5 = batting away
    '2.6 = game info
    '<game_info>
    '   Millwood pitched to 3 batters in the 6th.<br/>Shields, J pitched to 1 batter in the 7th.<br/> <br/><b>Pitches-strikes</b>: Millwood 100-64, Albers 16-9, Ohman 0-0, Shields, J 107-73, Choate 5-5.<br/><b>Groundouts-flyouts</b>: Millwood 3-6, Albers 2-0, Ohman 0-0, Shields, J 5-6, Choate 2-0.<br/><b>Batters faced</b>: Millwood 24, Albers 4, Ohman 0, Shields, J 29, Choate 2.<br/><b>Inherited runners-scored</b>: Albers 2-0, Ohman 1-0, Choate 1-0.<br/><b>Umpires</b>: HP: Dana DeMuth. 1B: Kerwin Danley. 2B: CB Bucknor. 3B: Doug Eddings.<br/><b>Weather</b>: 72 degrees, dome.<br/><b>Wind</b>: Indoors.<br/>
    '</game_info>


My scoring code is highly tailored for my needs, but if you have MS Excel 2000 + and would like a copy of what I have (Excel spreadsheet with VBA macros) you should be able to tweak it up to fit any needs. PM me your email and I will send you the .xls file.
wynams
College Coach
College Coach

User avatar

Posts: 200
(Past Year: 9)
Joined: 31 Mar 2006
Home Cafe: Baseball

Re: Best way to automate scoring for offline league

Postby wynams » Fri Jun 18, 2010 1:13 pm

Actually I think I just about have what you need without any coding required on your part.

If you could clear up a question ...

Everyone- 3-Hit, 1-RBI, 1-Run, -1-Out
1- 2-Run, 2-BB, 2-SB, -2-CS

ex. Shane Victorino yesterday 2/3 3 runs, 2BB, 2BI, 1HR and batted 1st
is the extra scoring per batting position in addition to or does it replace Everyone - points?

If added,
Victorino would get 3 points per RS, if replaced he would get 2 points.

Let me know and I will knock the rest of this out.
wynams
College Coach
College Coach

User avatar

Posts: 200
(Past Year: 9)
Joined: 31 Mar 2006
Home Cafe: Baseball

Re: Best way to automate scoring for offline league

Postby jbrady3324 » Fri Jun 18, 2010 1:30 pm

It would be in addition. So he would get 2+1 for every run scored if he was in the lead-off position as you described. I really appreciate the help!
jbrady3324
T-Ball Trainer


Posts: 4
Joined: 6 Apr 2010
Home Cafe: Baseball

Re: Best way to automate scoring for offline league

Postby wynams » Fri Jun 18, 2010 4:08 pm

PM sent. Was pretty straighforward changes. Pitching types (SP, MR, CL) was hard for me to determine how you determine, so I just score every pitcher as all 3 types. You can decide which one of the 3 you want on a per pitcher basis. I could do it by looking at the point they were brought in the game, but I don't currently parse that XML node and am on limited time through the rest of the weekend.

Cheers!
wynams
College Coach
College Coach

User avatar

Posts: 200
(Past Year: 9)
Joined: 31 Mar 2006
Home Cafe: Baseball


Return to Commissioner's Corner

Who is online

Users browsing this forum: No registered users and 1 guest

Forums Articles & Tips Sleepers Rankings Leagues


Today's Games
Friday, Apr. 18
(All times are EST, weather icons show forecast for game time)

Toronto at Cleveland
(2:20 pm)
LA Angels at Detroit
(7:05 pm)
Milwaukee at Pittsburgh
(7:05 pm)
St. Louis at Washington
(7:05 pm)
Miami at Miami
(7:08 pm)
indoors
NY Yankees at Tampa Bay
(7:10 pm)
indoors
Seattle at Seattle
(7:10 pm)
Atlanta at NY Mets
(7:10 pm)
Baltimore at Boston
(7:10 pm)
Chi White Sox at Texas
(8:05 pm)
Minnesota at Kansas City
(8:10 pm)
Philadelphia at Colorado
(8:40 pm)
Houston at Oakland
(10:05 pm)
Arizona at LA Dodgers
(10:10 pm)
San Francisco at San Diego
(10:10 pm)

  • Fantasy Baseball
  • Article Submissions
  • Privacy Statement
  • Site Survey 
  • Contact