xbox-live 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +29 -0
- data/Rakefile +2 -0
- data/lib/xbox-live.rb +21 -0
- data/lib/xbox-live/version.rb +5 -0
- data/spec/spec_helper.rb +21 -0
- data/spec/support/achievements.json +590 -0
- data/spec/support/friends.json +141 -0
- data/spec/support/games.json +980 -0
- data/spec/support/profile.json +31 -0
- data/spec/xbox_live_spec.rb +55 -0
- data/xbox-live.gemspec +21 -0
- metadata +115 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
{
|
2
|
+
"Data": {
|
3
|
+
"Tier": "gold",
|
4
|
+
"IsValid": 1,
|
5
|
+
"IsCheater": 0,
|
6
|
+
"IsOnline": 0,
|
7
|
+
"OnlineStatus": "Last seen 2 hours ago playing Netflix",
|
8
|
+
"XBLLaunchTeam": 0,
|
9
|
+
"NXELaunchTeam": 0,
|
10
|
+
"KinectLaunchTeam": 0,
|
11
|
+
"AvatarTile": "http:\/\/avatar.xboxlive.com\/avatar\/nicolasjensen\/avatarpic-l.png",
|
12
|
+
"AvatarSmall": "http:\/\/avatar.xboxlive.com\/avatar\/nicolasjensen\/avatarpic-s.png",
|
13
|
+
"AvatarLarge": "http:\/\/avatar.xboxlive.com\/avatar\/nicolasjensen\/avatarpic-l.png",
|
14
|
+
"AvatarBody": "http:\/\/avatar.xboxlive.com\/avatar\/nicolasjensen\/avatar-body.png",
|
15
|
+
"AvatarTileSSL": "https:\/\/avatar-ssl.xboxlive.com\/avatar\/nicolasjensen\/avatarpic-l.png",
|
16
|
+
"AvatarSmallSSL": "https:\/\/avatar-ssl.xboxlive.com\/avatar\/nicolasjensen\/avatarpic-s.png",
|
17
|
+
"AvatarLargeSSL": "https:\/\/avatar-ssl.xboxlive.com\/avatar\/nicolasjensen\/avatarpic-l.png",
|
18
|
+
"AvatarBodySSL": "https:\/\/avatar-ssl.xboxlive.com\/avatar\/nicolasjensen\/avatar-body.png",
|
19
|
+
"Gamertag": "nicolasjensen",
|
20
|
+
"GamerScore": 20631,
|
21
|
+
"Reputation": 20,
|
22
|
+
"Name": "Nicolas Iensen",
|
23
|
+
"Motto": "portalxbox.com.br",
|
24
|
+
"Location": "PORTO ALEGRE - BRASIL - RS",
|
25
|
+
"Bio": ""
|
26
|
+
},
|
27
|
+
"Stat": "ok",
|
28
|
+
"In": 2.187,
|
29
|
+
"Authed": "false",
|
30
|
+
"AuthedAs": null
|
31
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe XboxLive do
|
4
|
+
describe ".profile" do
|
5
|
+
context "when the gamertag exists" do
|
6
|
+
before do
|
7
|
+
Faraday.stub("get").
|
8
|
+
with('http://www.xboxleaders.com/api/profile.json?gamertag=nicolasjensen').
|
9
|
+
and_return(double(:body => File.open("spec/support/profile.json")))
|
10
|
+
end
|
11
|
+
it "should return a hash with the profile data" do
|
12
|
+
XboxLive.profile("nicolasjensen")["Data"]["Gamertag"].should be_== "nicolasjensen"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe ".games" do
|
18
|
+
context "when the gamertag exists" do
|
19
|
+
before do
|
20
|
+
Faraday.stub("get").
|
21
|
+
with('http://www.xboxleaders.com/api/games.json?gamertag=nicolasjensen').
|
22
|
+
and_return(double(:body => File.open("spec/support/games.json")))
|
23
|
+
end
|
24
|
+
it "should return a hash with the games data" do
|
25
|
+
XboxLive.games("nicolasjensen")["Data"]["PlayedGames"][0]["Title"].should be_== "FIFA 13"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe ".achievements" do
|
31
|
+
context "when the gamertag exists and the title id too" do
|
32
|
+
before do
|
33
|
+
Faraday.stub("get").
|
34
|
+
with('http://www.xboxleaders.com/api/achievements.json?gamertag=nicolasjensen&titleid=1161890128').
|
35
|
+
and_return(double(:body => File.open("spec/support/achievements.json")))
|
36
|
+
end
|
37
|
+
it "should return a hash with the achievements data" do
|
38
|
+
XboxLive.achievements("nicolasjensen", "1161890128")["Data"]["Achievements"][0]["Title"].should be_== "Scrap Metal"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe ".friends" do
|
44
|
+
context "when the gamertag exists" do
|
45
|
+
before do
|
46
|
+
Faraday.stub("get").
|
47
|
+
with('http://www.xboxleaders.com/api/friends.json?gamertag=nicolasjensen').
|
48
|
+
and_return(double(:body => File.open("spec/support/friends.json")))
|
49
|
+
end
|
50
|
+
it "should return a hash with the friends data" do
|
51
|
+
XboxLive.friends("nicolasjensen")["Data"]["Friends"][0]["Gamertag"].should be_== "cccav"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
data/xbox-live.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/xbox-live/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Nícolas Iensen"]
|
6
|
+
gem.email = ["nicolas@engage.is"]
|
7
|
+
gem.description = %q{This Xbox Live wrapper allows you to get profiles, games, achievements and friends data}
|
8
|
+
gem.summary = %q{A Ruby wrapper for the xboxleaders.com API}
|
9
|
+
gem.homepage = ""
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "xbox-live"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Xboxlive::Wrapper::VERSION
|
17
|
+
|
18
|
+
gem.add_runtime_dependency("faraday")
|
19
|
+
gem.add_runtime_dependency("multi_json")
|
20
|
+
gem.add_development_dependency("rspec")
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: xbox-live
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Nícolas Iensen
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-02-19 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: faraday
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: multi_json
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: This Xbox Live wrapper allows you to get profiles, games, achievements
|
63
|
+
and friends data
|
64
|
+
email:
|
65
|
+
- nicolas@engage.is
|
66
|
+
executables: []
|
67
|
+
extensions: []
|
68
|
+
extra_rdoc_files: []
|
69
|
+
files:
|
70
|
+
- .gitignore
|
71
|
+
- .rspec
|
72
|
+
- Gemfile
|
73
|
+
- LICENSE
|
74
|
+
- README.md
|
75
|
+
- Rakefile
|
76
|
+
- lib/xbox-live.rb
|
77
|
+
- lib/xbox-live/version.rb
|
78
|
+
- spec/spec_helper.rb
|
79
|
+
- spec/support/achievements.json
|
80
|
+
- spec/support/friends.json
|
81
|
+
- spec/support/games.json
|
82
|
+
- spec/support/profile.json
|
83
|
+
- spec/xbox_live_spec.rb
|
84
|
+
- xbox-live.gemspec
|
85
|
+
homepage: ''
|
86
|
+
licenses: []
|
87
|
+
post_install_message:
|
88
|
+
rdoc_options: []
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ! '>='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
requirements: []
|
104
|
+
rubyforge_project:
|
105
|
+
rubygems_version: 1.8.24
|
106
|
+
signing_key:
|
107
|
+
specification_version: 3
|
108
|
+
summary: A Ruby wrapper for the xboxleaders.com API
|
109
|
+
test_files:
|
110
|
+
- spec/spec_helper.rb
|
111
|
+
- spec/support/achievements.json
|
112
|
+
- spec/support/friends.json
|
113
|
+
- spec/support/games.json
|
114
|
+
- spec/support/profile.json
|
115
|
+
- spec/xbox_live_spec.rb
|