| By Timothy Fisher | Article Rating: |
|
| April 13, 2010 11:57 AM EDT | Reads: |
4,528 |
Let me start this post with a brief preface. If you are not a baseball fan who is interested in baseball statistics, this post will probably not hold much interest for you. However if you are, then you may be familiar with the MLB Gameday application and its data which is a great source of richly detailed MLB statistical data. This post will show you how to take that data from the MLB server and put it on your local machine for easier use, using the Gameday API.
Many users of the Gameday like to download the data files to work with them locally. Currently most people use a rather complex Perl script to download the Gameday XML data files. In this post I will show you how you can use the Gameday API to easily download some or all of the available data from the MLB Gameday servers.
This post assumes you know enough about Ruby to understand what the IRB console is. IRB is an easy to use interactive Ruby shell. For those who are not familiar with IRB, here is a tutorial that should get you started. To get started with downloading the Gameday data files, open up an IRB shell inside of the lib directory of the Gameday API. At the IRB prompt type this:
downloader = DataDownloader.new
downloader.download_all_for_month(2009,5)
And thats it! The first line imports the required Ruby class into your IRB session. The second line creates an instance of the DataDownloader class for you to use. The third line calls the download_all_for_month method which will start the download process. All of the Gameday files for the month of May in the year 2009 will be downloaded to your local file system. The files will be placed in the lib/components directory in your Gameday API folder with the lower level directory structure on MLB Gameday preserved. This will not happen instantly, it will take some time to download the entire month of game data.
Hopefully this will make it easier for some who have wanted to play with the Gameday data but felt intimidated by the Perl scripts that are around. As always, if I can help you out in anyway don’t hesitate to contact me. The best way these days is probably through Twitter, @tfisher.
Read the original blog entry...
Published April 13, 2010 Reads 4,528
Copyright © 2010 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Timothy Fisher
Timothy Fisher has recognized expertise in the areas of Java, Ruby, Rails, Social Media, Web 2.0, and Enterprise 2.o. He has served in technical leadership and senior architecture roles with companies such as Motorola, Cyclone Commerce, and Compuware. He is the author of the Java Phrasebook, and the Ruby on Rails Bible. Currently he is employed as a senior web architect with Compuware in Detroit, Michigan.
Follow Timothy on Twitter at http://twitter.com/tfisher
- GridGain Claims It’s Big Data 2.0
- VMware Cloud Foundry Open Tour Comes to San Francisco
- OneLogin Debuts Free Plan to Connect Active Directory with Cloud Apps
- VMware Cloud Foundry Open Tour Comes to Austin
- Key metrics used for web oriented storage systems monitoring on RIAK example
- The Zacks Analyst Blog Highlights: Hewlett-Packard, Amazon.com, IBM, Google and Salesforce.com
- Firm Interactive Partners with Green House Data for Their Cloud Services and Channel Program
- AppFog Joins OpenStack Community; Champions Developers through Commitment to Open Source and Open PaaS
- VMware Cloud Foundry Open Tour Comes to Portland
- AppFog PaaS is Verified as Citrix Ready
- ActiveState, CloudSigma Announce Stackato Reseller Agreement
- Cloud9 IDE and Cloud Foundry Team Up to Enable One-Click Deployment of Node.js Applications
- GridGain Claims It’s Big Data 2.0
- Belkin Launches New Keyboard Case and Accessories for the New iPad
- Using the Python SDK for Monitis Custom Monitors
- VMware Cloud Foundry Open Tour Comes to San Francisco
- OneLogin Debuts Free Plan to Connect Active Directory with Cloud Apps
- VMware Cloud Foundry Open Tour Comes to Austin
- Cloud Data Corporate Profile Business Overview; Next Generation Cloud Application Hosting
- Key metrics used for web oriented storage systems monitoring on RIAK example
- The Zacks Analyst Blog Highlights: Hewlett-Packard, Amazon.com, IBM, Google and Salesforce.com
- Firm Interactive Partners with Green House Data for Their Cloud Services and Channel Program
- AppFog Joins OpenStack Community; Champions Developers through Commitment to Open Source and Open PaaS
- VMware Cloud Foundry Open Tour Comes to Portland
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- Ruby on Rails Won't Make It in 2007 and Forget About AJAX
- The Jury's Still Out On Ruby On Rails (RoR) and AJAX
- The Top 250 Players in the Cloud Computing Ecosystem
- Red Hat Named "Platinum Sponsor" of Virtualization Conference & Expo
- Ruby on Rails Creator Says: "Reduce the Risk, Hire Programmers From Open Source"
- Java Kicks Ruby on Rails in the Butt
- Can Ruby Live Without Rails?
- An Introduction to Ant
- 4th International Cloud Computing Conference & Expo Starts Today
- Cloud Expo 2011 East To Attract 10,000 Delegates and 200 Exhibitors
- Testing in Ruby on Rails




















