Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gameday_api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gameday_api

  • 0.5.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Gameday API

The Gameday API allows you to fetch live statistical data from MLB.com servers. This is the same data that is used by the Gameday application available on MLB.com. Another project on GitHub uses the Gameday API to create an application that allows users to view linescore, boxscore, and play-by-play data for any selected game. That project is called Baseball Tracker.

Requirements

  • hpricot

Usage

Dumping an HTML Boxscore for a Specified Game: The code below will create a 'boxscore.html' file containing the boxscore for the Detroit Tigers game played on 9/15/2009.

 $: << File.expand_path(File.dirname(__FILE__) + "/../lib")
require 'team'
team = Team.new('det')
games = team.games_for_date('2009', '09', '15')
games[0].get_boxscore.dump_to_file

Print Linescores for the Specified Day The code below will output linescores for all games played on the date 9/15/2009.

 $: << File.expand_path(File.dirname(__FILE__) + "/../lib")
 require 'game'
 games = Game.find_by_date('2009','09','15')
 games.each do |game| 
   puts game.print_linescore
   puts
 end

Print all starting pitchers used by Detroit in 2009 The code below will output the name of the starting pitcher for all of Detroit's games from 2009. $: << File.expand_path(File.dirname(FILE) + "/../lib") require 'team' team = Team.new('det') games = team.all_games('2009') games.each do |game| starters = game.get_starting_pitchers if game.home_team_abbrev == 'det' puts 'Home: ' + starters[1]['name'] else puts 'Visitors: ' + starters[0]['name'] end end

Usage Restriction

All documents fetched by this API clearly state:

Copyright 2009 MLB Advanced Media, L.P. Use of any content on this page acknowledges agreement to the terms posted here http://gdx.mlb.com/components/copyright.txt

Which furthermore states:

The accounts, descriptions, data and presentation in the referring page (the "Materials") are proprietary content of MLB Advanced Media, L.P ("MLBAM").
Only individual, non-commercial, non-bulk use of the Materials is permitted and any other use of the Materials is prohibited without prior written authorization from MLBAM.
Authorized users of the Materials are prohibited from using the Materials in any commercial manner other than as expressly authorized by MLBAM.

Naturally, these terms are passed on to any who use this API. It is your responsibility to abide by them.

FAQs

Package last updated on 26 Aug 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc