openfooty 0.3.1 → 0.3.2
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/.gitignore +4 -0
- data/Gemfile +4 -0
- data/README.md +5 -13
- data/Rakefile +5 -29
- data/lib/openfooty.rb +2 -24
- data/lib/openfooty/version.rb +3 -0
- data/openfooty.gemspec +21 -62
- data/spec/openfooty/client_spec.rb +27 -0
- data/spec/spec_helper.rb +9 -0
- data/spec/vcr_cassettes/match_status.yml +95 -0
- data/spec/vcr_cassettes/team_squad.yml +33 -0
- data/spec/vcr_setup.rb +8 -0
- metadata +81 -35
- data/VERSION +0 -1
- data/init.rb +0 -1
- data/install.rb +0 -1
- data/tasks/openfooty_tasks.rake +0 -4
- data/test/fixtures/league_fixtures.json +0 -226
- data/test/fixtures/league_fixtures.xml +0 -186
- data/test/fixtures/match_stats.json +0 -1
- data/test/fixtures/match_stats.xml +0 -63
- data/test/fixtures/team_squad.json +0 -1
- data/test/fixtures/team_squad.xml +0 -37
- data/test/helper.rb +0 -37
- data/test/openfooty_test.rb +0 -35
- data/uninstall.rb +0 -1
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
CHANGED
@@ -8,9 +8,8 @@ As a gem:
|
|
8
8
|
|
9
9
|
sudo gem install openfooty
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
script/plugin install git://github.com/phuphighter/openfooty.git
|
11
|
+
In your Gemfile:
|
12
|
+
gem 'openfooty', '0.3.2'
|
14
13
|
|
15
14
|
## Get a Openfooty API key
|
16
15
|
|
@@ -20,20 +19,13 @@ Sign up for a Openfooty API key: [http://www.footytube.com/openfooty/signup.php]
|
|
20
19
|
|
21
20
|
### Configure
|
22
21
|
|
23
|
-
>> Openfooty
|
24
|
-
|
25
|
-
### or in an initializer
|
26
|
-
|
27
|
-
>> Openfooty.configure do |config|
|
28
|
-
>> config.api_key = 'your_api_key'
|
29
|
-
>> end
|
22
|
+
>> Openfooty::Client.new(:api_key => "your_api_key")
|
30
23
|
|
31
24
|
#### Examples
|
32
25
|
|
33
26
|
>> openfooty = Openfooty::Client.new
|
34
|
-
>>
|
35
|
-
|
36
|
-
=> "South Africa"
|
27
|
+
>> team_squad = @client.team("getSquad", :team_id => 2281).openfooty.players.player
|
28
|
+
=> team_squad.first.should == 'B. Bradley'
|
37
29
|
|
38
30
|
>> stats = openfooty.match("getStats", :match_id => 781512).openfooty.match
|
39
31
|
>> stats.home_team.assists.assist.last.player_name
|
data/Rakefile
CHANGED
@@ -1,31 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# MG.new("openfooty.gemspec")
|
1
|
+
require 'bundler'
|
2
|
+
require 'rspec/core/rake_task'
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
Jeweler::Tasks.new do |gem|
|
8
|
-
gem.name = "openfooty"
|
9
|
-
gem.summary = %Q{Ruby wrapper for the Openfooty API}
|
10
|
-
gem.description = %Q{Ruby wrapper for the Openfooty API}
|
11
|
-
gem.email = "johnnyn@gmail.com"
|
12
|
-
gem.homepage = "http://github.com/phuphighter/openfooty"
|
13
|
-
gem.authors = ["Johnny Khai Nguyen"]
|
14
|
-
|
15
|
-
gem.add_dependency('httparty', '>= 0.5.0')
|
16
|
-
gem.add_dependency('hashie', '>= 0.1.3')
|
17
|
-
end
|
18
|
-
Jeweler::GemcutterTasks.new
|
19
|
-
rescue LoadError
|
20
|
-
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
21
|
-
end
|
4
|
+
Bundler::GemHelper.install_tasks
|
5
|
+
RSpec::Core::RakeTask.new('spec')
|
22
6
|
|
23
|
-
|
24
|
-
Rake::TestTask.new(:test) do |test|
|
25
|
-
test.ruby_opts = ['-rubygems'] if defined? Gem
|
26
|
-
test.libs << 'lib' << 'test'
|
27
|
-
test.pattern = 'test/**/*_test.rb'
|
28
|
-
end
|
29
|
-
|
30
|
-
desc "Run tests"
|
31
|
-
task :default => :test
|
7
|
+
task :default => :spec
|
data/lib/openfooty.rb
CHANGED
@@ -1,29 +1,9 @@
|
|
1
|
-
|
2
|
-
gem 'httparty'
|
1
|
+
require 'rubygems'
|
3
2
|
require 'httparty'
|
4
3
|
require 'hashie'
|
5
|
-
|
6
|
-
directory = File.expand_path(File.dirname(__FILE__))
|
7
|
-
|
8
|
-
Hash.send :include, Hashie::HashExtensions
|
4
|
+
require File.join(File.dirname(__FILE__), 'openfooty', 'client')
|
9
5
|
|
10
6
|
module Openfooty
|
11
|
-
|
12
|
-
# create config/initializers/openfooty.rb
|
13
|
-
#
|
14
|
-
# Openfooty.configure do |config|
|
15
|
-
# config.api_key = 'api_key'
|
16
|
-
# end
|
17
|
-
# client = Openfooty::Client.new
|
18
|
-
#
|
19
|
-
# or
|
20
|
-
#
|
21
|
-
# Openfooty.api_key = 'api_key'
|
22
|
-
#
|
23
|
-
# or
|
24
|
-
#
|
25
|
-
# Openfooty::Client.new(:api_key => 'api_key', :api_type => 'api_type')
|
26
|
-
|
27
7
|
def self.configure
|
28
8
|
yield self
|
29
9
|
true
|
@@ -32,7 +12,5 @@ module Openfooty
|
|
32
12
|
class << self
|
33
13
|
attr_accessor :api_key
|
34
14
|
end
|
35
|
-
|
36
15
|
end
|
37
16
|
|
38
|
-
require File.join(directory, 'openfooty', 'client')
|
data/openfooty.gemspec
CHANGED
@@ -1,68 +1,27 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "openfooty/version"
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
7
|
-
s.name
|
8
|
-
s.version
|
6
|
+
s.name = "openfooty"
|
7
|
+
s.version = Openfooty::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Johnny Khai Nguyen"]
|
10
|
+
s.email = ["johnnyn@gmail.com"]
|
11
|
+
s.homepage = ""
|
12
|
+
s.summary = %q{Ruby wrapper for the OpenFooty API}
|
13
|
+
s.description = %q{Use this gem in your Ruby application to access the OpenFooty API}
|
9
14
|
|
10
|
-
s.
|
11
|
-
s.authors = ["Johnny Khai Nguyen"]
|
12
|
-
s.date = %q{2010-08-12}
|
13
|
-
s.description = %q{Ruby wrapper for the Openfooty API}
|
14
|
-
s.email = %q{johnnyn@gmail.com}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"README.md"
|
17
|
-
]
|
18
|
-
s.files = [
|
19
|
-
"MIT-LICENSE",
|
20
|
-
"README.md",
|
21
|
-
"Rakefile",
|
22
|
-
"VERSION",
|
23
|
-
"init.rb",
|
24
|
-
"install.rb",
|
25
|
-
"lib/openfooty.rb",
|
26
|
-
"lib/openfooty/client.rb",
|
27
|
-
"openfooty.gemspec",
|
28
|
-
"pkg/openfooty-0.1.0.gem",
|
29
|
-
"pkg/openfooty-0.2.0.gem",
|
30
|
-
"pkg/openfooty-0.3.0.gem",
|
31
|
-
"tasks/openfooty_tasks.rake",
|
32
|
-
"test/fixtures/league_fixtures.json",
|
33
|
-
"test/fixtures/league_fixtures.xml",
|
34
|
-
"test/fixtures/match_stats.json",
|
35
|
-
"test/fixtures/match_stats.xml",
|
36
|
-
"test/fixtures/team_squad.json",
|
37
|
-
"test/fixtures/team_squad.xml",
|
38
|
-
"test/helper.rb",
|
39
|
-
"test/openfooty_test.rb",
|
40
|
-
"uninstall.rb"
|
41
|
-
]
|
42
|
-
s.homepage = %q{http://github.com/phuphighter/openfooty}
|
43
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
44
|
-
s.require_paths = ["lib"]
|
45
|
-
s.rubygems_version = %q{1.3.6}
|
46
|
-
s.summary = %q{Ruby wrapper for the Openfooty API}
|
47
|
-
s.test_files = [
|
48
|
-
"test/helper.rb",
|
49
|
-
"test/openfooty_test.rb"
|
50
|
-
]
|
51
|
-
|
52
|
-
if s.respond_to? :specification_version then
|
53
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
54
|
-
s.specification_version = 3
|
15
|
+
s.rubyforge_project = "openfooty"
|
55
16
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
end
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
|
22
|
+
s.add_dependency 'httparty'
|
23
|
+
s.add_dependency 'hashie'
|
24
|
+
s.add_development_dependency 'rspec'
|
25
|
+
s.add_development_dependency 'fakeweb'
|
26
|
+
s.add_development_dependency 'vcr'
|
67
27
|
end
|
68
|
-
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Openfooty::Client do
|
4
|
+
|
5
|
+
context "request team squad members by team_id" do
|
6
|
+
use_vcr_cassette 'team_squad'
|
7
|
+
|
8
|
+
it "should return a team squad members for a given team_id" do
|
9
|
+
@client = Openfooty::Client.new(:api_key => "foobar")
|
10
|
+
team_squad = @client.team("getSquad", :team_id => 2281).openfooty.players.player
|
11
|
+
team_squad.size.should == 33
|
12
|
+
team_squad.first.should == 'B. Bradley'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context "request status by match_id" do
|
17
|
+
use_vcr_cassette 'match_status'
|
18
|
+
|
19
|
+
it "should return a list of stats for a given match_id" do
|
20
|
+
@client = Openfooty::Client.new(:api_key => "foobar")
|
21
|
+
match_stats = @client.match("getStats", :match_id => 781512).openfooty.match
|
22
|
+
match_stats.home_team.assists.assist.size.should == 2
|
23
|
+
match_stats.home_team.assists.assist.last.player_name.should == 'T. Cahill'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://api.openfooty.org:80/1.0/match.getStats?api_key=foobar&match_id=781512
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
|
+
code: 200
|
11
|
+
message: OK
|
12
|
+
headers:
|
13
|
+
expires:
|
14
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
15
|
+
content-type:
|
16
|
+
- text/xml
|
17
|
+
date:
|
18
|
+
- Tue, 21 Jun 2011 15:57:27 GMT
|
19
|
+
server:
|
20
|
+
- nginx
|
21
|
+
set-cookie:
|
22
|
+
- SESSID=1c6960ea466506e7893966f6342c9f30; path=/; domain=.footytube.com
|
23
|
+
- lang=deleted; expires=Mon, 21-Jun-2010 15:57:26 GMT; path=/; domain=.footytube.com
|
24
|
+
cache-control:
|
25
|
+
- no-store, no-cache, must-revalidate, post-check=0, pre-check=0
|
26
|
+
pragma:
|
27
|
+
- no-cache
|
28
|
+
transfer-encoding:
|
29
|
+
- chunked
|
30
|
+
body: |
|
31
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
32
|
+
<openfooty version="1.0">
|
33
|
+
<match>
|
34
|
+
<ht_score>0-1</ht_score>
|
35
|
+
<score>2-1</score>
|
36
|
+
<winner>674</winner>
|
37
|
+
<date>2010-04-25 14:00:00</date>
|
38
|
+
<status>Played</status>
|
39
|
+
<home_team id="674">
|
40
|
+
<name>Everton</name>
|
41
|
+
<lineup>
|
42
|
+
<player id="632">T. Howard</player>
|
43
|
+
<player id="2846">S. Distin</player>
|
44
|
+
<player id="2868">T. Hibbert</player>
|
45
|
+
<player id="2600">P. Jagielka</player>
|
46
|
+
<player id="2672">L. Baines</player>
|
47
|
+
<player id="2876">M. Arteta</player>
|
48
|
+
<player id="6472">D. Bilyaletdinov</player>
|
49
|
+
<player id="1960">S. Pienaar</player>
|
50
|
+
<player id="2874">P. Neville</player>
|
51
|
+
<player id="709">T. Cahill</player>
|
52
|
+
<player id="2839">A. Yakubu</player>
|
53
|
+
<substitution player_id_off="6472" player_id_on="2886">V. Anichebe for D. Bilyaletdinov (45)</substitution>
|
54
|
+
<substitution player_id_off="2874" player_id_on="552">L. Saha for P. Neville (60)</substitution>
|
55
|
+
<substitution player_id_off="2839" player_id_on="55559">J. Baxter for A. Yakubu (87)</substitution>
|
56
|
+
</lineup>
|
57
|
+
<goals count="2">
|
58
|
+
<goal type="owngoal" time="49" player_id="79474" player_name="C. Smalling"/>
|
59
|
+
<goal type="penalty" time="90" player_id="2876" player_name="M. Arteta"/>
|
60
|
+
</goals>
|
61
|
+
<assists count="2">
|
62
|
+
<assist time="49" player_id="2886" player_name="V. Anichebe"/>
|
63
|
+
<assist time="90" player_id="709" player_name="T. Cahill"/>
|
64
|
+
</assists>
|
65
|
+
<cards count="0"/>
|
66
|
+
</home_team>
|
67
|
+
<away_team id="667">
|
68
|
+
<name>Fulham</name>
|
69
|
+
<lineup>
|
70
|
+
<player id="702">M. Schwarzer</player>
|
71
|
+
<player id="15481">C. Baird</player>
|
72
|
+
<player id="79474">C. Smalling</player>
|
73
|
+
<player id="611">J. Paintsil</player>
|
74
|
+
<player id="2568">N. Shorey</player>
|
75
|
+
<player id="21660">K. Dikgacoi</player>
|
76
|
+
<player id="664">C. Dempsey</player>
|
77
|
+
<player id="15429">J. Greening</player>
|
78
|
+
<player id="7773">B. Riise</player>
|
79
|
+
<player id="2288">E. Nevland</player>
|
80
|
+
<player id="18418">S. Okaka Chuka</player>
|
81
|
+
<substitution player_id_off="2288" player_id_on="6275">D. Elm for E. Nevland (78)</substitution>
|
82
|
+
<substitution player_id_off="18418" player_id_on="7905">F. Stoor for S. Okaka Chuka (89)</substitution>
|
83
|
+
</lineup>
|
84
|
+
<goals count="1">
|
85
|
+
<goal type="normal" time="36" player_id="2288" player_name="E. Nevland"/>
|
86
|
+
</goals>
|
87
|
+
<assists count="0"/>
|
88
|
+
<cards count="1">
|
89
|
+
<card type="yellow" time="39" player_id="611" player_name="J. Paintsil"/>
|
90
|
+
</cards>
|
91
|
+
</away_team>
|
92
|
+
</match>
|
93
|
+
</openfooty>
|
94
|
+
|
95
|
+
http_version: "1.1"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://api.openfooty.org:80/1.0/team.getSquad?api_key=foobar&team_id=2281
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
|
+
code: 200
|
11
|
+
message: OK
|
12
|
+
headers:
|
13
|
+
expires:
|
14
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
15
|
+
content-type:
|
16
|
+
- text/xml
|
17
|
+
date:
|
18
|
+
- Tue, 21 Jun 2011 15:57:27 GMT
|
19
|
+
server:
|
20
|
+
- nginx
|
21
|
+
set-cookie:
|
22
|
+
- SESSID=462df9d8e74505d4ca631db2a87148eb; path=/; domain=.footytube.com
|
23
|
+
- lang=deleted; expires=Mon, 21-Jun-2010 15:57:20 GMT; path=/; domain=.footytube.com
|
24
|
+
cache-control:
|
25
|
+
- no-store, no-cache, must-revalidate, post-check=0, pre-check=0
|
26
|
+
pragma:
|
27
|
+
- no-cache
|
28
|
+
transfer-encoding:
|
29
|
+
- chunked
|
30
|
+
body: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
|
31
|
+
<openfooty version=\"1.0\">\n <response status=\"ok\"/>\n <players team_id=\"2281\">\n <player id=\"130156\" position=\"\">B. Bradley</player>\n <player id=\"6912\" position=\"Goalkeeper\">B. Guzan</player>\n <player id=\"629\" position=\"Goalkeeper\">M. Hahnemann</player>\n <player id=\"632\" position=\"Goalkeeper\">T. Howard</player>\n <player id=\"643\" position=\"Defender\">C. Bocanegra</player>\n <player id=\"6906\" position=\"Defender\">J. Bornstein</player>\n <player id=\"104666\" position=\"Defender\">S. Cherundolo</player>\n <player id=\"7261\" position=\"Defender\">C. Goodson</player>\n <player id=\"655\" position=\"Defender\">O. Onyewu</player>\n <player id=\"2712\" position=\"Defender\">J. Spector</player>\n <player id=\"76707\" position=\"Midfielder\">A. Bedoya</player>\n <player id=\"2304\" position=\"Midfielder\">M. Bradley</player>\n <player id=\"10049\" position=\"Midfielder\">R. Clark</player>\n <player id=\"664\" position=\"Midfielder\">C. Dempsey</player>\n <player id=\"666\" position=\"Attacker\">L. Donovan</player>\n <player id=\"7452\" position=\"Midfielder\">M. Edu</player>\n <player id=\"2008\" position=\"Midfielder\">B. Feilhaber</player>\n <player id=\"7305\" position=\"Midfielder\">S. Holden</player>\n <player id=\"6915\" position=\"Midfielder\">S. Klje\xC5\xA1tan</player>\n <player id=\"14359\" position=\"Midfielder\">J. Torres</player>\n <player id=\"7422\" position=\"Attacker\">J. Altidore</player>\n <player id=\"7445\" position=\"Attacker\">E. Buddle</player>\n <player id=\"7345\" position=\"Attacker\">R. Findley</player>\n <player id=\"6937\" position=\"Attacker\">H. G\xC3\xB3mez</player>\n <player id=\"73686\" position=\"Defender\">O. Gonzalez</player>\n <player id=\"38367\" position=\"Goalkeeper\">D. Yelldell</player>\n <player id=\"90118\" position=\"Defender\">E. Lichaj</player>\n <player id=\"124014\" position=\"Defender\">T. Ream</player>\n <player id=\"75700\" position=\"Midfielder\">M. Diskerud</player>\n <player id=\"1801\" position=\"Midfielder\">J. Jones</player>\n <player id=\"103168\" position=\"Attacker\">J. Agudelo</player>\n <player id=\"57720\" position=\"Attacker\">T. Chandler</player>\n <player id=\"2541\" position=\"Defender\">J. DeMerit</player>\n </players>\n\
|
32
|
+
</openfooty>\n"
|
33
|
+
http_version: "1.1"
|
data/spec/vcr_setup.rb
ADDED
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openfooty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
9
|
+
- 2
|
10
|
+
version: 0.3.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Johnny Khai Nguyen
|
@@ -14,98 +15,143 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date:
|
18
|
+
date: 2011-06-21 00:00:00 -05:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: httparty
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
27
30
|
segments:
|
28
31
|
- 0
|
29
|
-
|
30
|
-
- 0
|
31
|
-
version: 0.5.0
|
32
|
+
version: "0"
|
32
33
|
type: :runtime
|
33
34
|
version_requirements: *id001
|
34
35
|
- !ruby/object:Gem::Dependency
|
35
36
|
name: hashie
|
36
37
|
prerelease: false
|
37
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
38
40
|
requirements:
|
39
41
|
- - ">="
|
40
42
|
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
41
44
|
segments:
|
42
45
|
- 0
|
43
|
-
|
44
|
-
- 3
|
45
|
-
version: 0.1.3
|
46
|
+
version: "0"
|
46
47
|
type: :runtime
|
47
48
|
version_requirements: *id002
|
48
|
-
|
49
|
-
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: rspec
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !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
|
+
type: :development
|
62
|
+
version_requirements: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: fakeweb
|
65
|
+
prerelease: false
|
66
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
75
|
+
type: :development
|
76
|
+
version_requirements: *id004
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: vcr
|
79
|
+
prerelease: false
|
80
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
hash: 3
|
86
|
+
segments:
|
87
|
+
- 0
|
88
|
+
version: "0"
|
89
|
+
type: :development
|
90
|
+
version_requirements: *id005
|
91
|
+
description: Use this gem in your Ruby application to access the OpenFooty API
|
92
|
+
email:
|
93
|
+
- johnnyn@gmail.com
|
50
94
|
executables: []
|
51
95
|
|
52
96
|
extensions: []
|
53
97
|
|
54
|
-
extra_rdoc_files:
|
55
|
-
|
98
|
+
extra_rdoc_files: []
|
99
|
+
|
56
100
|
files:
|
101
|
+
- .gitignore
|
102
|
+
- Gemfile
|
57
103
|
- MIT-LICENSE
|
58
104
|
- README.md
|
59
105
|
- Rakefile
|
60
|
-
- VERSION
|
61
|
-
- init.rb
|
62
|
-
- install.rb
|
63
106
|
- lib/openfooty.rb
|
64
107
|
- lib/openfooty/client.rb
|
108
|
+
- lib/openfooty/version.rb
|
65
109
|
- openfooty.gemspec
|
66
110
|
- pkg/openfooty-0.1.0.gem
|
67
111
|
- pkg/openfooty-0.2.0.gem
|
68
112
|
- pkg/openfooty-0.3.0.gem
|
69
|
-
-
|
70
|
-
-
|
71
|
-
-
|
72
|
-
-
|
73
|
-
-
|
74
|
-
- test/fixtures/team_squad.json
|
75
|
-
- test/fixtures/team_squad.xml
|
76
|
-
- test/helper.rb
|
77
|
-
- test/openfooty_test.rb
|
78
|
-
- uninstall.rb
|
113
|
+
- spec/openfooty/client_spec.rb
|
114
|
+
- spec/spec_helper.rb
|
115
|
+
- spec/vcr_cassettes/match_status.yml
|
116
|
+
- spec/vcr_cassettes/team_squad.yml
|
117
|
+
- spec/vcr_setup.rb
|
79
118
|
has_rdoc: true
|
80
|
-
homepage:
|
119
|
+
homepage: ""
|
81
120
|
licenses: []
|
82
121
|
|
83
122
|
post_install_message:
|
84
|
-
rdoc_options:
|
85
|
-
|
123
|
+
rdoc_options: []
|
124
|
+
|
86
125
|
require_paths:
|
87
126
|
- lib
|
88
127
|
required_ruby_version: !ruby/object:Gem::Requirement
|
128
|
+
none: false
|
89
129
|
requirements:
|
90
130
|
- - ">="
|
91
131
|
- !ruby/object:Gem::Version
|
132
|
+
hash: 3
|
92
133
|
segments:
|
93
134
|
- 0
|
94
135
|
version: "0"
|
95
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
96
138
|
requirements:
|
97
139
|
- - ">="
|
98
140
|
- !ruby/object:Gem::Version
|
141
|
+
hash: 3
|
99
142
|
segments:
|
100
143
|
- 0
|
101
144
|
version: "0"
|
102
145
|
requirements: []
|
103
146
|
|
104
|
-
rubyforge_project:
|
105
|
-
rubygems_version: 1.
|
147
|
+
rubyforge_project: openfooty
|
148
|
+
rubygems_version: 1.6.2
|
106
149
|
signing_key:
|
107
150
|
specification_version: 3
|
108
|
-
summary: Ruby wrapper for the
|
151
|
+
summary: Ruby wrapper for the OpenFooty API
|
109
152
|
test_files:
|
110
|
-
-
|
111
|
-
-
|
153
|
+
- spec/openfooty/client_spec.rb
|
154
|
+
- spec/spec_helper.rb
|
155
|
+
- spec/vcr_cassettes/match_status.yml
|
156
|
+
- spec/vcr_cassettes/team_squad.yml
|
157
|
+
- spec/vcr_setup.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.3.1
|
data/init.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Include hook code here
|
data/install.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Install hook code here
|
data/tasks/openfooty_tasks.rake
DELETED
@@ -1,226 +0,0 @@
|
|
1
|
-
|
2
|
-
{
|
3
|
-
"openfooty":
|
4
|
-
{
|
5
|
-
"version":"1.0",
|
6
|
-
"response":
|
7
|
-
{
|
8
|
-
"status":"ok"
|
9
|
-
},
|
10
|
-
"fixtures":
|
11
|
-
{
|
12
|
-
"hasMorePages":"true",
|
13
|
-
"nextPage":2,
|
14
|
-
"match":
|
15
|
-
[
|
16
|
-
{
|
17
|
-
"match_id":"878771",
|
18
|
-
"league":
|
19
|
-
{
|
20
|
-
"id":"72",
|
21
|
-
"season_id":"4770",
|
22
|
-
"cdata":"World Cup"
|
23
|
-
},
|
24
|
-
"home_team":
|
25
|
-
{
|
26
|
-
"team_id":"2014",
|
27
|
-
"cdata":"South Africa"
|
28
|
-
},
|
29
|
-
"away_team":
|
30
|
-
{
|
31
|
-
"team_id":"1497",
|
32
|
-
"cdata":"Mexico"
|
33
|
-
},
|
34
|
-
"date":
|
35
|
-
{
|
36
|
-
"ts":"1276264800",
|
37
|
-
"cdata":"2010-06-11 14:00:00"
|
38
|
-
},
|
39
|
-
"status":
|
40
|
-
{
|
41
|
-
"cdata":"Fixture"
|
42
|
-
},
|
43
|
-
"ft_score":
|
44
|
-
{
|
45
|
-
"cdata":null
|
46
|
-
},
|
47
|
-
"winner":
|
48
|
-
{
|
49
|
-
"cdata":null
|
50
|
-
}
|
51
|
-
},
|
52
|
-
{
|
53
|
-
"match_id":"878772",
|
54
|
-
"league":
|
55
|
-
{
|
56
|
-
"id":"72",
|
57
|
-
"season_id":"4770",
|
58
|
-
"cdata":"World Cup"
|
59
|
-
}
|
60
|
-
},
|
61
|
-
{
|
62
|
-
"match_id":"878778",
|
63
|
-
"league":
|
64
|
-
{
|
65
|
-
"id":"72",
|
66
|
-
"season_id":"4770",
|
67
|
-
"cdata":"World Cup"
|
68
|
-
}
|
69
|
-
},
|
70
|
-
{
|
71
|
-
"match_id":"878777",
|
72
|
-
"league":
|
73
|
-
{
|
74
|
-
"id":"72",
|
75
|
-
"season_id":"4770",
|
76
|
-
"cdata":"World Cup"
|
77
|
-
}
|
78
|
-
},
|
79
|
-
{
|
80
|
-
"match_id":"878783",
|
81
|
-
"league":
|
82
|
-
{
|
83
|
-
"id":"72",
|
84
|
-
"season_id":"4770",
|
85
|
-
"cdata":"World Cup"
|
86
|
-
}
|
87
|
-
},
|
88
|
-
{
|
89
|
-
"match_id":"878784",
|
90
|
-
"league":
|
91
|
-
{
|
92
|
-
"id":"72",
|
93
|
-
"season_id":"4770",
|
94
|
-
"cdata":"World Cup"
|
95
|
-
}
|
96
|
-
},
|
97
|
-
{
|
98
|
-
"match_id":"878790",
|
99
|
-
"league":
|
100
|
-
{
|
101
|
-
"id":"72",
|
102
|
-
"season_id":"4770",
|
103
|
-
"cdata":"World Cup"
|
104
|
-
}
|
105
|
-
},
|
106
|
-
{
|
107
|
-
"match_id":"878789",
|
108
|
-
"league":
|
109
|
-
{
|
110
|
-
"id":"72",
|
111
|
-
"season_id":"4770",
|
112
|
-
"cdata":"World Cup"
|
113
|
-
}
|
114
|
-
},
|
115
|
-
{
|
116
|
-
"match_id":"878795",
|
117
|
-
"league":
|
118
|
-
{
|
119
|
-
"id":"72",
|
120
|
-
"season_id":"4770",
|
121
|
-
"cdata":"World Cup"
|
122
|
-
}
|
123
|
-
},
|
124
|
-
{
|
125
|
-
"match_id":"878796",
|
126
|
-
"league":
|
127
|
-
{
|
128
|
-
"id":"72",
|
129
|
-
"season_id":"4770",
|
130
|
-
"cdata":"World Cup"
|
131
|
-
}
|
132
|
-
},
|
133
|
-
{
|
134
|
-
"match_id":"878801",
|
135
|
-
"league":
|
136
|
-
{
|
137
|
-
"id":"72",
|
138
|
-
"season_id":"4770",
|
139
|
-
"cdata":"World Cup"
|
140
|
-
}
|
141
|
-
},
|
142
|
-
{
|
143
|
-
"match_id":"878802",
|
144
|
-
"league":
|
145
|
-
{
|
146
|
-
"id":"72",
|
147
|
-
"season_id":"4770",
|
148
|
-
"cdata":"World Cup"
|
149
|
-
}
|
150
|
-
},
|
151
|
-
{
|
152
|
-
"match_id":"878808",
|
153
|
-
"league":
|
154
|
-
{
|
155
|
-
"id":"72",
|
156
|
-
"season_id":"4770",
|
157
|
-
"cdata":"World Cup"
|
158
|
-
}
|
159
|
-
},
|
160
|
-
{
|
161
|
-
"match_id":"878807",
|
162
|
-
"league":
|
163
|
-
{
|
164
|
-
"id":"72",
|
165
|
-
"season_id":"4770",
|
166
|
-
"cdata":"World Cup"
|
167
|
-
}
|
168
|
-
},
|
169
|
-
{
|
170
|
-
"match_id":"878814",
|
171
|
-
"league":
|
172
|
-
{
|
173
|
-
"id":"72",
|
174
|
-
"season_id":"4770",
|
175
|
-
"cdata":"World Cup"
|
176
|
-
}
|
177
|
-
},
|
178
|
-
{
|
179
|
-
"match_id":"878813",
|
180
|
-
"league":
|
181
|
-
{
|
182
|
-
"id":"72",
|
183
|
-
"season_id":"4770",
|
184
|
-
"cdata":"World Cup"
|
185
|
-
}
|
186
|
-
},
|
187
|
-
{
|
188
|
-
"match_id":"878773",
|
189
|
-
"league":
|
190
|
-
{
|
191
|
-
"id":"72",
|
192
|
-
"season_id":"4770",
|
193
|
-
"cdata":"World Cup"
|
194
|
-
}
|
195
|
-
},
|
196
|
-
{
|
197
|
-
"match_id":"878779",
|
198
|
-
"league":
|
199
|
-
{
|
200
|
-
"id":"72",
|
201
|
-
"season_id":"4770",
|
202
|
-
"cdata":"World Cup"
|
203
|
-
}
|
204
|
-
},
|
205
|
-
{
|
206
|
-
"match_id":"878780",
|
207
|
-
"league":
|
208
|
-
{
|
209
|
-
"id":"72",
|
210
|
-
"season_id":"4770",
|
211
|
-
"cdata":"World Cup"
|
212
|
-
}
|
213
|
-
},
|
214
|
-
{
|
215
|
-
"match_id":"878774",
|
216
|
-
"league":
|
217
|
-
{
|
218
|
-
"id":"72",
|
219
|
-
"season_id":"4770",
|
220
|
-
"cdata":"World Cup"
|
221
|
-
}
|
222
|
-
}
|
223
|
-
]
|
224
|
-
}
|
225
|
-
}
|
226
|
-
}
|
@@ -1,186 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<openfooty version="1.0">
|
3
|
-
<response status="ok"/>
|
4
|
-
<fixtures hasMorePages="true" nextPage="2">
|
5
|
-
<match match_id="878771">
|
6
|
-
<league id="72" season_id="4770">World Cup</league>
|
7
|
-
<home_team team_id="2014">South Africa</home_team>
|
8
|
-
<away_team team_id="1497">Mexico</away_team>
|
9
|
-
<date ts="1276264800">2010-06-11 14:00:00</date>
|
10
|
-
<status>Fixture</status>
|
11
|
-
<ft_score></ft_score>
|
12
|
-
<winner></winner>
|
13
|
-
</match>
|
14
|
-
<match match_id="878772">
|
15
|
-
<league id="72" season_id="4770">World Cup</league>
|
16
|
-
<home_team team_id="2300">Uruguay</home_team>
|
17
|
-
<away_team team_id="944">France</away_team>
|
18
|
-
<date ts="1276281000">2010-06-11 18:30:00</date>
|
19
|
-
<status>Fixture</status>
|
20
|
-
<ft_score></ft_score>
|
21
|
-
<winner></winner>
|
22
|
-
</match>
|
23
|
-
<match match_id="878778">
|
24
|
-
<league id="72" season_id="4770">World Cup</league>
|
25
|
-
<home_team team_id="1385">Korea Republic</home_team>
|
26
|
-
<away_team team_id="1091">Greece</away_team>
|
27
|
-
<date ts="1276342200">2010-06-12 11:30:00</date>
|
28
|
-
<status>Fixture</status>
|
29
|
-
<ft_score></ft_score>
|
30
|
-
<winner></winner>
|
31
|
-
</match>
|
32
|
-
<match match_id="878777">
|
33
|
-
<league id="72" season_id="4770">World Cup</league>
|
34
|
-
<home_team team_id="132">Argentina</home_team>
|
35
|
-
<away_team team_id="1567">Nigeria</away_team>
|
36
|
-
<date ts="1276351200">2010-06-12 14:00:00</date>
|
37
|
-
<status>Fixture</status>
|
38
|
-
<ft_score></ft_score>
|
39
|
-
<winner></winner>
|
40
|
-
</match>
|
41
|
-
<match match_id="878783">
|
42
|
-
<league id="72" season_id="4770">World Cup</league>
|
43
|
-
<home_team team_id="774">England</home_team>
|
44
|
-
<away_team team_id="2281">United States</away_team>
|
45
|
-
<date ts="1276367400">2010-06-12 18:30:00</date>
|
46
|
-
<status>Fixture</status>
|
47
|
-
<ft_score></ft_score>
|
48
|
-
<winner></winner>
|
49
|
-
</match>
|
50
|
-
<match match_id="878784">
|
51
|
-
<league id="72" season_id="4770">World Cup</league>
|
52
|
-
<home_team team_id="78">Algeria</home_team>
|
53
|
-
<away_team team_id="2011">Slovenia</away_team>
|
54
|
-
<date ts="1276428600">2010-06-13 11:30:00</date>
|
55
|
-
<status>Fixture</status>
|
56
|
-
<ft_score></ft_score>
|
57
|
-
<winner></winner>
|
58
|
-
</match>
|
59
|
-
<match match_id="878790">
|
60
|
-
<league id="72" season_id="4770">World Cup</league>
|
61
|
-
<home_team team_id="6816">Serbia</home_team>
|
62
|
-
<away_team team_id="1038">Ghana</away_team>
|
63
|
-
<date ts="1276437600">2010-06-13 14:00:00</date>
|
64
|
-
<status>Fixture</status>
|
65
|
-
<ft_score></ft_score>
|
66
|
-
<winner></winner>
|
67
|
-
</match>
|
68
|
-
<match match_id="878789">
|
69
|
-
<league id="72" season_id="4770">World Cup</league>
|
70
|
-
<home_team team_id="1037">Germany</home_team>
|
71
|
-
<away_team team_id="156">Australia</away_team>
|
72
|
-
<date ts="1276453800">2010-06-13 18:30:00</date>
|
73
|
-
<status>Fixture</status>
|
74
|
-
<ft_score></ft_score>
|
75
|
-
<winner></winner>
|
76
|
-
</match>
|
77
|
-
<match match_id="878795">
|
78
|
-
<league id="72" season_id="4770">World Cup</league>
|
79
|
-
<home_team team_id="1552">Netherlands</home_team>
|
80
|
-
<away_team team_id="643">Denmark</away_team>
|
81
|
-
<date ts="1276515000">2010-06-14 11:30:00</date>
|
82
|
-
<status>Fixture</status>
|
83
|
-
<ft_score></ft_score>
|
84
|
-
<winner></winner>
|
85
|
-
</match>
|
86
|
-
<match match_id="878796">
|
87
|
-
<league id="72" season_id="4770">World Cup</league>
|
88
|
-
<home_team team_id="1348">Japan</home_team>
|
89
|
-
<away_team team_id="386">Cameroon</away_team>
|
90
|
-
<date ts="1276524000">2010-06-14 14:00:00</date>
|
91
|
-
<status>Fixture</status>
|
92
|
-
<ft_score></ft_score>
|
93
|
-
<winner></winner>
|
94
|
-
</match>
|
95
|
-
<match match_id="878801">
|
96
|
-
<league id="72" season_id="4770">World Cup</league>
|
97
|
-
<home_team team_id="1318">Italy</home_team>
|
98
|
-
<away_team team_id="1630">Paraguay</away_team>
|
99
|
-
<date ts="1276540200">2010-06-14 18:30:00</date>
|
100
|
-
<status>Fixture</status>
|
101
|
-
<ft_score></ft_score>
|
102
|
-
<winner></winner>
|
103
|
-
</match>
|
104
|
-
<match match_id="878802">
|
105
|
-
<league id="72" season_id="4770">World Cup</league>
|
106
|
-
<home_team team_id="1564">New Zealand</home_team>
|
107
|
-
<away_team team_id="1998">Slovakia</away_team>
|
108
|
-
<date ts="1276601400">2010-06-15 11:30:00</date>
|
109
|
-
<status>Fixture</status>
|
110
|
-
<ft_score></ft_score>
|
111
|
-
<winner></winner>
|
112
|
-
</match>
|
113
|
-
<match match_id="878808">
|
114
|
-
<league id="72" season_id="4770">World Cup</league>
|
115
|
-
<home_team team_id="598">Ivory Coast</home_team>
|
116
|
-
<away_team team_id="1772">Portugal</away_team>
|
117
|
-
<date ts="1276610400">2010-06-15 14:00:00</date>
|
118
|
-
<status>Fixture</status>
|
119
|
-
<ft_score></ft_score>
|
120
|
-
<winner></winner>
|
121
|
-
</match>
|
122
|
-
<match match_id="878807">
|
123
|
-
<league id="72" season_id="4770">World Cup</league>
|
124
|
-
<home_team team_id="349">Brazil</home_team>
|
125
|
-
<away_team team_id="1371">Korea DPR</away_team>
|
126
|
-
<date ts="1276626600">2010-06-15 18:30:00</date>
|
127
|
-
<status>Fixture</status>
|
128
|
-
<ft_score></ft_score>
|
129
|
-
<winner></winner>
|
130
|
-
</match>
|
131
|
-
<match match_id="878814">
|
132
|
-
<league id="72" season_id="4770">World Cup</league>
|
133
|
-
<home_team team_id="1099">Honduras</home_team>
|
134
|
-
<away_team team_id="424">Chile</away_team>
|
135
|
-
<date ts="1276687800">2010-06-16 11:30:00</date>
|
136
|
-
<status>Fixture</status>
|
137
|
-
<ft_score></ft_score>
|
138
|
-
<winner></winner>
|
139
|
-
</match>
|
140
|
-
<match match_id="878813">
|
141
|
-
<league id="72" season_id="4770">World Cup</league>
|
142
|
-
<home_team team_id="2137">Spain</home_team>
|
143
|
-
<away_team team_id="2201">Switzerland</away_team>
|
144
|
-
<date ts="1276696800">2010-06-16 14:00:00</date>
|
145
|
-
<status>Fixture</status>
|
146
|
-
<ft_score></ft_score>
|
147
|
-
<winner></winner>
|
148
|
-
</match>
|
149
|
-
<match match_id="878773">
|
150
|
-
<league id="72" season_id="4770">World Cup</league>
|
151
|
-
<home_team team_id="2014">South Africa</home_team>
|
152
|
-
<away_team team_id="2300">Uruguay</away_team>
|
153
|
-
<date ts="1276713000">2010-06-16 18:30:00</date>
|
154
|
-
<status>Fixture</status>
|
155
|
-
<ft_score></ft_score>
|
156
|
-
<winner></winner>
|
157
|
-
</match>
|
158
|
-
<match match_id="878779">
|
159
|
-
<league id="72" season_id="4770">World Cup</league>
|
160
|
-
<home_team team_id="132">Argentina</home_team>
|
161
|
-
<away_team team_id="1385">Korea Republic</away_team>
|
162
|
-
<date ts="1276774200">2010-06-17 11:30:00</date>
|
163
|
-
<status>Fixture</status>
|
164
|
-
<ft_score></ft_score>
|
165
|
-
<winner></winner>
|
166
|
-
</match>
|
167
|
-
<match match_id="878780">
|
168
|
-
<league id="72" season_id="4770">World Cup</league>
|
169
|
-
<home_team team_id="1091">Greece</home_team>
|
170
|
-
<away_team team_id="1567">Nigeria</away_team>
|
171
|
-
<date ts="1276783200">2010-06-17 14:00:00</date>
|
172
|
-
<status>Fixture</status>
|
173
|
-
<ft_score></ft_score>
|
174
|
-
<winner></winner>
|
175
|
-
</match>
|
176
|
-
<match match_id="878774">
|
177
|
-
<league id="72" season_id="4770">World Cup</league>
|
178
|
-
<home_team team_id="944">France</home_team>
|
179
|
-
<away_team team_id="1497">Mexico</away_team>
|
180
|
-
<date ts="1276799400">2010-06-17 18:30:00</date>
|
181
|
-
<status>Fixture</status>
|
182
|
-
<ft_score></ft_score>
|
183
|
-
<winner></winner>
|
184
|
-
</match>
|
185
|
-
</fixtures>
|
186
|
-
</openfooty>
|
@@ -1 +0,0 @@
|
|
1
|
-
{"openfooty"=>{"version"=>"1.0", "match"=>{"home_team"=>{"name"=>{"cdata"=>"Everton"}, "goals"=>{"goal"=>[{"player_name"=>"C. Smalling", "time"=>49, "player_id"=>79474, "type"=>"owngoal"}, {"player_name"=>"M. Arteta", "time"=>90, "player_id"=>2876, "type"=>"penalty"}], "count"=>2}, "cards"=>{"count"=>0}, "assists"=>{"count"=>2, "assist"=>[{"player_name"=>"V. Anichebe", "time"=>49, "player_id"=>2886}, {"player_name"=>"T. Cahill", "time"=>90, "player_id"=>709}]}, "id"=>"674", "lineup"=>{"player"=>[{"cdata"=>"T. Howard", "id"=>632}, {"cdata"=>"S. Distin", "id"=>2846}, {"cdata"=>"T. Hibbert", "id"=>2868}, {"cdata"=>"P. Jagielka", "id"=>2600}, {"cdata"=>"L. Baines", "id"=>2672}, {"cdata"=>"M. Arteta", "id"=>2876}, {"cdata"=>"D. Bilyaletdinov", "id"=>6472}, {"cdata"=>"S. Pienaar", "id"=>1960}, {"cdata"=>"P. Neville", "id"=>2874}, {"cdata"=>"T. Cahill", "id"=>709}, {"cdata"=>"A. Yakubu", "id"=>2839}], "substitution"=>[{"cdata"=>"V. Anichebe for D. Bilyaletdinov (45)", "player_id_on"=>"2886", "player_id_off"=>"6472"}, {"cdata"=>"L. Saha for P. Neville (60)", "player_id_on"=>"552", "player_id_off"=>"2874"}, {"cdata"=>"J. Baxter for A. Yakubu (87)", "player_id_on"=>"55559", "player_id_off"=>"2839"}]}}, "winner"=>{"cdata"=>"674"}, "date"=>{"cdata"=>"2010-04-25 14:00:00"}, "away_team"=>{"name"=>{"cdata"=>"Fulham"}, "goals"=>{"goal"=>{"player_name"=>"E. Nevland", "time"=>36, "player_id"=>2288, "type"=>"normal"}, "count"=>1}, "cards"=>{"card"=>{"player_name"=>"J. Paintsil", "time"=>39, "player_id"=>611, "type"=>"yellow"}, "count"=>1}, "assists"=>{"count"=>0}, "id"=>"667", "lineup"=>{"player"=>[{"cdata"=>"M. Schwarzer", "id"=>702}, {"cdata"=>"C. Baird", "id"=>15481}, {"cdata"=>"C. Smalling", "id"=>79474}, {"cdata"=>"J. Paintsil", "id"=>611}, {"cdata"=>"N. Shorey", "id"=>2568}, {"cdata"=>"K. Dikgacoi", "id"=>21660}, {"cdata"=>"C. Dempsey", "id"=>664}, {"cdata"=>"J. Greening", "id"=>15429}, {"cdata"=>"B. Riise", "id"=>7773}, {"cdata"=>"E. Nevland", "id"=>2288}, {"cdata"=>"S. Okaka Chuka", "id"=>18418}], "substitution"=>[{"cdata"=>"D. Elm for E. Nevland (78)", "player_id_on"=>"6275", "player_id_off"=>"2288"}, {"cdata"=>"F. Stoor for S. Okaka Chuka (89)", "player_id_on"=>"7905", "player_id_off"=>"18418"}]}}, "status"=>{"cdata"=>"Played"}, "score"=>{"cdata"=>"2-1"}, "ht_score"=>{"cdata"=>"0-1"}}}}
|
@@ -1,63 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<openfooty version="1.0">
|
3
|
-
<match>
|
4
|
-
<ht_score>0-1</ht_score>
|
5
|
-
<score>2-1</score>
|
6
|
-
<winner>674</winner>
|
7
|
-
<date>2010-04-25 14:00:00</date>
|
8
|
-
<status>Played</status>
|
9
|
-
<home_team id="674">
|
10
|
-
<name>Everton</name>
|
11
|
-
<lineup>
|
12
|
-
<player id="632">T. Howard</player>
|
13
|
-
<player id="2846">S. Distin</player>
|
14
|
-
<player id="2868">T. Hibbert</player>
|
15
|
-
<player id="2600">P. Jagielka</player>
|
16
|
-
<player id="2672">L. Baines</player>
|
17
|
-
<player id="2876">M. Arteta</player>
|
18
|
-
<player id="6472">D. Bilyaletdinov</player>
|
19
|
-
<player id="1960">S. Pienaar</player>
|
20
|
-
<player id="2874">P. Neville</player>
|
21
|
-
<player id="709">T. Cahill</player>
|
22
|
-
<player id="2839">A. Yakubu</player>
|
23
|
-
<substitution player_id_off="6472" player_id_on="2886">V. Anichebe for D. Bilyaletdinov (45)</substitution>
|
24
|
-
<substitution player_id_off="2874" player_id_on="552">L. Saha for P. Neville (60)</substitution>
|
25
|
-
<substitution player_id_off="2839" player_id_on="55559">J. Baxter for A. Yakubu (87)</substitution>
|
26
|
-
</lineup>
|
27
|
-
<goals count="2">
|
28
|
-
<goal type="owngoal" time="49" player_id="79474" player_name="C. Smalling"/>
|
29
|
-
<goal type="penalty" time="90" player_id="2876" player_name="M. Arteta"/>
|
30
|
-
</goals>
|
31
|
-
<assists count="2">
|
32
|
-
<assist time="49" player_id="2886" player_name="V. Anichebe"/>
|
33
|
-
<assist time="90" player_id="709" player_name="T. Cahill"/>
|
34
|
-
</assists>
|
35
|
-
<cards count="0"/>
|
36
|
-
</home_team>
|
37
|
-
<away_team id="667">
|
38
|
-
<name>Fulham</name>
|
39
|
-
<lineup>
|
40
|
-
<player id="702">M. Schwarzer</player>
|
41
|
-
<player id="15481">C. Baird</player>
|
42
|
-
<player id="79474">C. Smalling</player>
|
43
|
-
<player id="611">J. Paintsil</player>
|
44
|
-
<player id="2568">N. Shorey</player>
|
45
|
-
<player id="21660">K. Dikgacoi</player>
|
46
|
-
<player id="664">C. Dempsey</player>
|
47
|
-
<player id="15429">J. Greening</player>
|
48
|
-
<player id="7773">B. Riise</player>
|
49
|
-
<player id="2288">E. Nevland</player>
|
50
|
-
<player id="18418">S. Okaka Chuka</player>
|
51
|
-
<substitution player_id_off="2288" player_id_on="6275">D. Elm for E. Nevland (78)</substitution>
|
52
|
-
<substitution player_id_off="18418" player_id_on="7905">F. Stoor for S. Okaka Chuka (89)</substitution>
|
53
|
-
</lineup>
|
54
|
-
<goals count="1">
|
55
|
-
<goal type="normal" time="36" player_id="2288" player_name="E. Nevland"/>
|
56
|
-
</goals>
|
57
|
-
<assists count="0"/>
|
58
|
-
<cards count="1">
|
59
|
-
<card type="yellow" time="39" player_id="611" player_name="J. Paintsil"/>
|
60
|
-
</cards>
|
61
|
-
</away_team>
|
62
|
-
</match>
|
63
|
-
</openfooty>
|
@@ -1 +0,0 @@
|
|
1
|
-
{"openfooty"=>{"players"=>{"player"=>[{"position"=>"", "cdata"=>"B. Bradley", "id"=>"130156"}, {"position"=>"Goalkeeper", "cdata"=>"B. Guzan", "id"=>"6912"}, {"position"=>"Goalkeeper", "cdata"=>"M. Hahnemann", "id"=>"629"}, {"position"=>"Goalkeeper", "cdata"=>"T. Howard", "id"=>"632"}, {"position"=>"Defender", "cdata"=>"C. Bocanegra", "id"=>"643"}, {"position"=>"Defender", "cdata"=>"J. Bornstein", "id"=>"6906"}, {"position"=>"Defender", "cdata"=>"S. Cherundolo", "id"=>"104666"}, {"position"=>"Defender", "cdata"=>"J. DeMerit", "id"=>"2541"}, {"position"=>"Defender", "cdata"=>"C. Goodson", "id"=>"7261"}, {"position"=>"Defender", "cdata"=>"C. Marshall", "id"=>"7214"}, {"position"=>"Defender", "cdata"=>"O. Onyewu", "id"=>"655"}, {"position"=>"Defender", "cdata"=>"H. Pearce", "id"=>"16404"}, {"position"=>"Defender", "cdata"=>"J. Spector", "id"=>"2712"}, {"position"=>"Midfielder", "cdata"=>"D. Beasley", "id"=>"659"}, {"position"=>"Midfielder", "cdata"=>"A. Bedoya", "id"=>"76707"}, {"position"=>"Midfielder", "cdata"=>"M. Bradley", "id"=>"2304"}, {"position"=>"Midfielder", "cdata"=>"R. Clark", "id"=>"10049"}, {"position"=>"Midfielder", "cdata"=>"C. Dempsey", "id"=>"664"}, {"position"=>"Midfielder", "cdata"=>"L. Donovan", "id"=>"666"}, {"position"=>"Midfielder", "cdata"=>"M. Edu", "id"=>"7452"}, {"position"=>"Midfielder", "cdata"=>"B. Feilhaber", "id"=>"2008"}, {"position"=>"Midfielder", "cdata"=>"S. Holden", "id"=>"7305"}, {"position"=>"Midfielder", "cdata"=>"S. Kljestan", "id"=>"6915"}, {"position"=>"Midfielder", "cdata"=>"R. Rogers", "id"=>"7226"}, {"position"=>"Midfielder", "cdata"=>"J. Torres", "id"=>"14359"}, {"position"=>"Attacker", "cdata"=>"J. Altidore", "id"=>"7422"}, {"position"=>"Attacker", "cdata"=>"E. Buddle", "id"=>"7445"}, {"position"=>"Attacker", "cdata"=>"B. Ching", "id"=>"673"}, {"position"=>"Attacker", "cdata"=>"R. Findley", "id"=>"7345"}, {"position"=>"Attacker", "cdata"=>"H. Gómez", "id"=>"6937"}, {"position"=>"Attacker", "cdata"=>"E. Johnson", "id"=>"674"}], "team_id"=>"2281"}, "response"=>{"status"=>"ok"}, "version"=>"1.0"}}
|
@@ -1,37 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<openfooty version="1.0">
|
3
|
-
<response status="ok"/>
|
4
|
-
<players team_id="2281">
|
5
|
-
<player id="130156" position="">B. Bradley</player>
|
6
|
-
<player id="6912" position="Goalkeeper">B. Guzan</player>
|
7
|
-
<player id="629" position="Goalkeeper">M. Hahnemann</player>
|
8
|
-
<player id="632" position="Goalkeeper">T. Howard</player>
|
9
|
-
<player id="643" position="Defender">C. Bocanegra</player>
|
10
|
-
<player id="6906" position="Defender">J. Bornstein</player>
|
11
|
-
<player id="104666" position="Defender">S. Cherundolo</player>
|
12
|
-
<player id="2541" position="Defender">J. DeMerit</player>
|
13
|
-
<player id="7261" position="Defender">C. Goodson</player>
|
14
|
-
<player id="7214" position="Defender">C. Marshall</player>
|
15
|
-
<player id="655" position="Defender">O. Onyewu</player>
|
16
|
-
<player id="16404" position="Defender">H. Pearce</player>
|
17
|
-
<player id="2712" position="Defender">J. Spector</player>
|
18
|
-
<player id="659" position="Midfielder">D. Beasley</player>
|
19
|
-
<player id="76707" position="Midfielder">A. Bedoya</player>
|
20
|
-
<player id="2304" position="Midfielder">M. Bradley</player>
|
21
|
-
<player id="10049" position="Midfielder">R. Clark</player>
|
22
|
-
<player id="664" position="Midfielder">C. Dempsey</player>
|
23
|
-
<player id="666" position="Midfielder">L. Donovan</player>
|
24
|
-
<player id="7452" position="Midfielder">M. Edu</player>
|
25
|
-
<player id="2008" position="Midfielder">B. Feilhaber</player>
|
26
|
-
<player id="7305" position="Midfielder">S. Holden</player>
|
27
|
-
<player id="6915" position="Midfielder">S. Kljestan</player>
|
28
|
-
<player id="7226" position="Midfielder">R. Rogers</player>
|
29
|
-
<player id="14359" position="Midfielder">J. Torres</player>
|
30
|
-
<player id="7422" position="Attacker">J. Altidore</player>
|
31
|
-
<player id="7445" position="Attacker">E. Buddle</player>
|
32
|
-
<player id="673" position="Attacker">B. Ching</player>
|
33
|
-
<player id="7345" position="Attacker">R. Findley</player>
|
34
|
-
<player id="6937" position="Attacker">H. Gómez</player>
|
35
|
-
<player id="674" position="Attacker">E. Johnson</player>
|
36
|
-
</players>
|
37
|
-
</openfooty>
|
data/test/helper.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
require 'pathname'
|
3
|
-
require 'rubygems'
|
4
|
-
|
5
|
-
require 'shoulda'
|
6
|
-
require 'matchy'
|
7
|
-
require 'fakeweb'
|
8
|
-
|
9
|
-
begin require 'redgreen'; rescue LoadError; end
|
10
|
-
|
11
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
12
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
13
|
-
require 'openfooty'
|
14
|
-
|
15
|
-
# Set the default allow_net_connect option--usually you'll want this off.
|
16
|
-
# You don't usually want your test suite to make HTTP connections, do you?
|
17
|
-
|
18
|
-
FakeWeb.allow_net_connect = false
|
19
|
-
|
20
|
-
class Test::Unit::TestCase
|
21
|
-
end
|
22
|
-
|
23
|
-
def fixture_file(filename)
|
24
|
-
return '' if filename == ''
|
25
|
-
file_path = File.expand_path(File.dirname(__FILE__) + '/fixtures/' + filename)
|
26
|
-
File.read(file_path)
|
27
|
-
end
|
28
|
-
|
29
|
-
def openfooty_url(url, options={})
|
30
|
-
url =~ /^http/ ? url : "http://api.openfooty.org/1.0#{url}"
|
31
|
-
end
|
32
|
-
|
33
|
-
def stub_get(url, filename, options={})
|
34
|
-
opts = {:body => fixture_file(filename)}.merge(options)
|
35
|
-
|
36
|
-
FakeWeb.register_uri(:get, openfooty_url(url), opts)
|
37
|
-
end
|
data/test/openfooty_test.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
|
-
class OpenfootyTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
context "Openfooty API" do
|
6
|
-
|
7
|
-
setup do
|
8
|
-
@client = Openfooty::Client.new(:api_key => 'openfootyapikey')
|
9
|
-
end
|
10
|
-
|
11
|
-
should "return a list of fixtures for given league_id" do
|
12
|
-
stub_get("http://api.openfooty.org/1.0/league.getFixtures?league_id=72&api_key=openfootyapikey", "league_fixtures.xml")
|
13
|
-
league_fixtures = @client.league("getFixtures", :league_id => 72).openfooty.fixtures.match
|
14
|
-
league_fixtures.size.should == 20
|
15
|
-
league_fixtures.first.home_team.should == 'South Africa'
|
16
|
-
league_fixtures.first.away_team.should == 'Mexico'
|
17
|
-
end
|
18
|
-
|
19
|
-
should "return a team squad members for a given team_id" do
|
20
|
-
stub_get("http://api.openfooty.org/1.0/team.getSquad?api_key=openfootyapikey&team_id=2281", "team_squad.xml")
|
21
|
-
team_squad = @client.team("getSquad", :team_id => 2281).openfooty.players.player
|
22
|
-
team_squad.size.should == 31
|
23
|
-
team_squad.first.should == 'B. Bradley'
|
24
|
-
end
|
25
|
-
|
26
|
-
should "return a list of stats for a given match_id" do
|
27
|
-
stub_get("http://api.openfooty.org/1.0/match.getStats?match_id=781512&api_key=openfootyapikey", "match_stats.xml")
|
28
|
-
match_stats = @client.match("getStats", :match_id => 781512).openfooty.match
|
29
|
-
match_stats.home_team.assists.assist.size.should == 2
|
30
|
-
match_stats.home_team.assists.assist.last.player_name.should == 'T. Cahill'
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
data/uninstall.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Uninstall hook code here
|