gameday_api 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +20 -0
- data/README +65 -0
- metadata +69 -0
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 timothyf
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
Gameday API
|
2
|
+
|
3
|
+
The Gameday API allows you to fetch live statistical data from MLB.com servers. This is the same data that is used by the
|
4
|
+
Gameday application available on MLB.com. Another project on GitHub uses the Gameday API to create an application
|
5
|
+
that allows users to view linescore, boxscore, and play-by-play data for any selected game. That project is called
|
6
|
+
Baseball Tracker.
|
7
|
+
|
8
|
+
|
9
|
+
Requirements
|
10
|
+
|
11
|
+
* hpricot
|
12
|
+
|
13
|
+
|
14
|
+
Usage
|
15
|
+
|
16
|
+
Dumping an HTML Boxscore for a Specified Game:
|
17
|
+
The code below will create a 'boxscore.html' file containing the boxscore for the Detroit Tigers game played on 9/15/2009.
|
18
|
+
|
19
|
+
$: << File.expand_path(File.dirname(__FILE__) + "/../lib")
|
20
|
+
require 'team'
|
21
|
+
team = Team.new('det')
|
22
|
+
games = team.games_for_date('2009', '09', '15')
|
23
|
+
games[0].get_boxscore.dump_to_file
|
24
|
+
|
25
|
+
|
26
|
+
Print Linescores for the Specified Day
|
27
|
+
The code below will output linescores for all games played on the date 9/15/2009.
|
28
|
+
|
29
|
+
$: << File.expand_path(File.dirname(__FILE__) + "/../lib")
|
30
|
+
require 'game'
|
31
|
+
games = Game.find_by_date('2009','09','15')
|
32
|
+
games.each do |game|
|
33
|
+
puts game.print_linescore
|
34
|
+
puts
|
35
|
+
end
|
36
|
+
|
37
|
+
Print all starting pitchers used by Detroit in 2009
|
38
|
+
The code below will output the name of the starting pitcher for all of Detroit's games from 2009.
|
39
|
+
$: << File.expand_path(File.dirname(__FILE__) + "/../lib")
|
40
|
+
require 'team'
|
41
|
+
team = Team.new('det')
|
42
|
+
games = team.all_games('2009')
|
43
|
+
games.each do |game|
|
44
|
+
starters = game.get_starting_pitchers
|
45
|
+
if game.home_team_abbrev == 'det'
|
46
|
+
puts 'Home: ' + starters[1]['name']
|
47
|
+
else
|
48
|
+
puts 'Visitors: ' + starters[0]['name']
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
Usage Restriction
|
55
|
+
|
56
|
+
All documents fetched by this API clearly state:
|
57
|
+
|
58
|
+
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
|
59
|
+
|
60
|
+
Which furthermore states:
|
61
|
+
|
62
|
+
The accounts, descriptions, data and presentation in the referring page (the "Materials") are proprietary content of MLB Advanced Media, L.P ("MLBAM").<br />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.<br />Authorized users of the Materials are prohibited from using the Materials in any commercial manner other than as expressly authorized by MLBAM.
|
63
|
+
|
64
|
+
Naturally, these terms are passed on to any who use this API. It is your responsibility to abide by them.
|
65
|
+
|
metadata
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gameday_api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 11
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 5
|
9
|
+
- 0
|
10
|
+
version: 0.5.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- timothyf
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-07-18 00:00:00 -04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description: An API for processing live MLB statistics.
|
23
|
+
email: timothyf@gmail.com
|
24
|
+
executables: []
|
25
|
+
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files:
|
29
|
+
- LICENSE
|
30
|
+
- README
|
31
|
+
files:
|
32
|
+
- LICENSE
|
33
|
+
- README
|
34
|
+
has_rdoc: true
|
35
|
+
homepage: http://github.com/timothyf/gameday_api
|
36
|
+
licenses: []
|
37
|
+
|
38
|
+
post_install_message:
|
39
|
+
rdoc_options:
|
40
|
+
- --charset=UTF-8
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
hash: 3
|
49
|
+
segments:
|
50
|
+
- 0
|
51
|
+
version: "0"
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
requirements: []
|
62
|
+
|
63
|
+
rubyforge_project:
|
64
|
+
rubygems_version: 1.3.7
|
65
|
+
signing_key:
|
66
|
+
specification_version: 3
|
67
|
+
summary: An API for processing live MLB statistics.
|
68
|
+
test_files: []
|
69
|
+
|