Perl Rosterpad Project
The scripts described on this page can be used to load current Major League Baseball statistics into Rosterpad, data which is then loaded to Scorepad when you define the teams in Scorepad's new game setup. This allows you to have current statistics for each Major League batter and pitcher as the game progresses. So, when you score a Major League Baseball game, you get the actual number of home runs, strikeouts, etc. for Barry Bonds, Chipper Jones, Curt Schilling or any MLB player!
Statistics are those that are available publicly on many web sites such as espn.com. I use stats from the fantasy download link on yahoo.com because it provides the data in a convenient format.
If you are a Windows user, you can accomplish the same thing by simply subscribing to the MLB Stats service available from www.scorepad.com. However, since my preference is Unix/Macintosh, the MLB Stats program is not available to me. Note also that the publicly available stats are a subset of the complete stats available from Scorepad's MLB Stats service. That is, there are many interesting stats that are not readily available from free sources. So if you want it all, subscribe to MLB Stats.
Without further ado, here are the necessary files and instructions for creating your own Rosterpad MLB stats file.
Please note that the scripts and procedures below have been tested with Scorepad 4.1. A newer version of Scorepad (4.5) was released near the end of the 2002 MLB season but I have not yet tried it out.
1. You must have a working installation of Perl (It's free!). I'm using Perl 5.6.0. For Windows users, a good place to find Perl is at www.activestate.com. Mac OS X 10.2 comes with Perl 5.6.0, though you must first install the Developer's Tools in order to install the additional Perl modules as required in the next step.
2. You'll need the Perl modules Palm:Raw and Palm:PDB. In Windows, you may be able to use the Perl Package Manage (ppm) to install these. In Mac OS X you can use 'perl -MCPAN -eshell' at a terminal prompt and then enter the following commands when you are connected to the internet (this only works if you have the Developer Tools installed):
3. Next you'll need the MLB team roster files from Baseball Roster Central. There are 30 separate html files, one for each team.
4. Then get a copy of the latest Yahoo Fantasy Download stats file available here. *UPDATE: The Yahoo MLB stats site has been re-organized. I don't know if they plan a fantasy download similar to past seasons. Stay tuned. [Updated 01/18/2003]
5. If you want Rosterpad to suggest a starting lineup, you will need to create a lineup file. You can download a sample here that I used during the 2002 MLB season. Before each game that I was planning to score, I just updated the file manually with the prior day's starting lineups for each team but with the current day's starting pitcher.
6. You'll also need an empty Rosterpad file that we will 'fill up' by running the Perl scripts below. I have one here that seems sufficiently large to handle even the large number of MLB players that pile up by the end of the MLB season.
7. Finally you'll need two Perl scripts. The first, roster.pl, creates a single roster file from the 30 team files and the lineup file.
8. The second Perl script is makePdb.pl, the script used to create the Rosterpad file.
How to Run the Scripts
9. Place all of the above data files and Perl scripts in the same folder. For the team roster files, create a folder 'rosters' in the main folder and place the 30 team html files into this folder. Do not rename any files!
10. From the command prompt, run roster.pl. This creates a file, roster.txt, which is the combined rosters for all 30 teams.
11. From the command prompt, run makePdb.pl. This makes a copy of ScorePlayerDB.PDB and then adds the roster data to it. The resulting file is called new_pdb.pdb.
12. Install the file on your Palm via the normal Palm installer.
Now you have current stats for all Major League Baseball players in your Palm!
Above article Last updated: Fri, 29 Mar 2013 18:06:50 -0400