xbox_live 0.3.3 → 0.3.4
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/example-usage.rb +1 -1
- data/lib/xbox_live.rb +0 -4
- data/lib/xbox_live/achievements_page.rb +1 -1
- data/lib/xbox_live/version.rb +1 -1
- data/spec/scraper_spec.rb +4 -22
- metadata +24 -9
data/example-usage.rb
CHANGED
|
@@ -16,5 +16,5 @@ puts "Score in '#{first_game.name}': #{first_game.unlocked_points} out of #{firs
|
|
|
16
16
|
|
|
17
17
|
achievements_page = XboxLive::AchievementsPage.new(player, first_game.id)
|
|
18
18
|
first_ach = achievements_page.achievements.first
|
|
19
|
-
puts "Unlocked achievement '#{first_ach.name}'
|
|
19
|
+
puts "Unlocked achievement '#{first_ach.name}' at '#{first_ach.unlocked_at}'"
|
|
20
20
|
|
data/lib/xbox_live.rb
CHANGED
|
@@ -43,7 +43,7 @@ module XboxLive
|
|
|
43
43
|
|
|
44
44
|
# POST to retrieve the JSON data about achievements for this game
|
|
45
45
|
def retrieve_achievement_data
|
|
46
|
-
data = @page.body.match(
|
|
46
|
+
data = @page.body.match(/\(routes\.activity\.details\.load,(.*?\);)/)[1][0..-3]
|
|
47
47
|
JSON.parse(data)
|
|
48
48
|
end
|
|
49
49
|
|
data/lib/xbox_live/version.rb
CHANGED
data/spec/scraper_spec.rb
CHANGED
|
@@ -3,28 +3,10 @@ require 'spec_helper'
|
|
|
3
3
|
describe XboxLive::Scraper do
|
|
4
4
|
|
|
5
5
|
describe "#get_page" do
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
it 'should return a Mechanize::Page instance' do
|
|
11
|
-
@page.class.should == Mechanize::Page
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
it 'should return the page with the expected title' do
|
|
15
|
-
@page.title.strip.should == 'Major Nelson - Xbox.com'
|
|
16
|
-
end
|
|
17
|
-
|
|
6
|
+
it "should return a Mechanize::Page instance" do
|
|
7
|
+
@page = XboxLive::Scraper.get_page('http://live.xbox.com/en-US/MyXbox/Profile?gamertag=major%20nelson')
|
|
8
|
+
@page.should_not be_nil
|
|
9
|
+
@page.class.should == Mechanize::Page
|
|
18
10
|
end
|
|
19
|
-
|
|
20
|
-
context "with a private (authenticated) page" do
|
|
21
|
-
before { @page = XboxLive::Scraper.get_page('http://live.xbox.com/en-US/MyXbox/Profile?gamertag=major%20nelson') }
|
|
22
|
-
|
|
23
|
-
it 'should return the page with the expected title' do
|
|
24
|
-
@page.title.strip.should == 'Major Nelson - Xbox.com'
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
end
|
|
28
|
-
|
|
29
11
|
end
|
|
30
12
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: xbox_live
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.4
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,11 +9,11 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2012-05-16 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: mechanize
|
|
16
|
-
requirement:
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
17
|
none: false
|
|
18
18
|
requirements:
|
|
19
19
|
- - ~>
|
|
@@ -21,10 +21,15 @@ dependencies:
|
|
|
21
21
|
version: '1.0'
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
|
-
version_requirements:
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
26
|
+
requirements:
|
|
27
|
+
- - ~>
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: '1.0'
|
|
25
30
|
- !ruby/object:Gem::Dependency
|
|
26
31
|
name: json
|
|
27
|
-
requirement:
|
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
|
28
33
|
none: false
|
|
29
34
|
requirements:
|
|
30
35
|
- - ! '>='
|
|
@@ -32,10 +37,15 @@ dependencies:
|
|
|
32
37
|
version: '0'
|
|
33
38
|
type: :runtime
|
|
34
39
|
prerelease: false
|
|
35
|
-
version_requirements:
|
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
42
|
+
requirements:
|
|
43
|
+
- - ! '>='
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '0'
|
|
36
46
|
- !ruby/object:Gem::Dependency
|
|
37
47
|
name: rspec
|
|
38
|
-
requirement:
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
39
49
|
none: false
|
|
40
50
|
requirements:
|
|
41
51
|
- - ~>
|
|
@@ -43,7 +53,12 @@ dependencies:
|
|
|
43
53
|
version: '2.6'
|
|
44
54
|
type: :development
|
|
45
55
|
prerelease: false
|
|
46
|
-
version_requirements:
|
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
+
none: false
|
|
58
|
+
requirements:
|
|
59
|
+
- - ~>
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '2.6'
|
|
47
62
|
description: Log into Xbox Live and retrieve information about a player
|
|
48
63
|
email:
|
|
49
64
|
- mikefischer99@gmail.com
|
|
@@ -87,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
87
102
|
version: '0'
|
|
88
103
|
requirements: []
|
|
89
104
|
rubyforge_project: xbox_live
|
|
90
|
-
rubygems_version: 1.8.
|
|
105
|
+
rubygems_version: 1.8.24
|
|
91
106
|
signing_key:
|
|
92
107
|
specification_version: 3
|
|
93
108
|
summary: Xbox Live data retrieval
|