halo-reach-api 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +43 -0
- data/.rvmrc +1 -0
- data/CHANGELOG.md +19 -0
- data/Gemfile +1 -14
- data/README.rdoc +4 -23
- data/Rakefile +3 -44
- data/halo-reach-api.gemspec +20 -71
- data/lib/halo-reach-api.rb +69 -14
- data/lib/version.rb +7 -0
- data/test/test_halo-reach-api.rb +1 -1
- metadata +88 -113
- data/VERSION +0 -1
data/.gitignore
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# rcov generated
|
2
|
+
coverage
|
3
|
+
|
4
|
+
# rdoc generated
|
5
|
+
rdoc
|
6
|
+
|
7
|
+
# yard generated
|
8
|
+
doc
|
9
|
+
.yardoc
|
10
|
+
|
11
|
+
# bundler
|
12
|
+
.bundle
|
13
|
+
|
14
|
+
# jeweler generated
|
15
|
+
pkg
|
16
|
+
|
17
|
+
Gemfile.lock
|
18
|
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
19
|
+
#
|
20
|
+
# * Create a file at ~/.gitignore
|
21
|
+
# * Include files you want ignored
|
22
|
+
# * Run: git config --global core.excludesfile ~/.gitignore
|
23
|
+
#
|
24
|
+
# After doing this, these files will be ignored in all your git projects,
|
25
|
+
# saving you from having to 'pollute' every project you touch with them
|
26
|
+
#
|
27
|
+
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
28
|
+
#
|
29
|
+
# For MacOS:
|
30
|
+
#
|
31
|
+
#.DS_Store
|
32
|
+
#
|
33
|
+
# For TextMate
|
34
|
+
#*.tmproj
|
35
|
+
#tmtags
|
36
|
+
#
|
37
|
+
# For emacs:
|
38
|
+
#*~
|
39
|
+
#\#*
|
40
|
+
#.\#*
|
41
|
+
#
|
42
|
+
# For vim:
|
43
|
+
#*.swp
|
data/.rvmrc
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## 1.0.5
|
4
|
+
|
5
|
+
* Fix escaping with gamertags with spaces
|
6
|
+
|
7
|
+
## 1.0.4
|
8
|
+
|
9
|
+
* Removed explicit version dependencies on supporting development-only libraries
|
10
|
+
* Fixed JSON in tests to not be stupid about null values
|
11
|
+
* Fixed copy-and-paste errors in tests
|
12
|
+
|
13
|
+
## 1.0.3
|
14
|
+
|
15
|
+
* Fixed some internal Ruby API deprecation warnings
|
16
|
+
|
17
|
+
## 1.0.2
|
18
|
+
|
19
|
+
* Added set_timeout method to set timeout for HTTP requests
|
data/Gemfile
CHANGED
@@ -1,17 +1,4 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
# Include everything needed to run rake, tests, features, etc.
|
5
|
-
group :development do
|
6
|
-
gem "bundler"
|
7
|
-
gem "jeweler"
|
8
|
-
gem "rcov"
|
9
|
-
end
|
3
|
+
gemspec
|
10
4
|
|
11
|
-
gem 'httparty'
|
12
|
-
gem 'json'
|
13
|
-
|
14
|
-
group :test do
|
15
|
-
gem 'fakeweb'
|
16
|
-
gem 'mocha'
|
17
|
-
end
|
data/README.rdoc
CHANGED
@@ -4,6 +4,7 @@ Ruby gem for interacting with the Halo:Reach API
|
|
4
4
|
|
5
5
|
* Official: http://www.bungie.net/fanclub/statsapi/Group/Resources/Article.aspx?cid=545064
|
6
6
|
* Unofficial wiki: http://www.haloreachapi.net/wiki/Available_methods
|
7
|
+
* You must register with Bungie.net and you can then generate an API key at http://www.bungie.net/Account/reachapikey.aspx
|
7
8
|
|
8
9
|
== Requirements
|
9
10
|
|
@@ -14,13 +15,13 @@ Ruby gem for interacting with the Halo:Reach API
|
|
14
15
|
|
15
16
|
== Install
|
16
17
|
|
17
|
-
*
|
18
|
+
* gem install halo-reach-api
|
18
19
|
|
19
20
|
== Example
|
20
21
|
|
21
22
|
>> require 'halo-reach-api'
|
22
23
|
=> true
|
23
|
-
>> halo_reach_api = Halo::Reach::API.new('xxx') #
|
24
|
+
>> halo_reach_api = Halo::Reach::API.new('xxx') # Where 'xxx' is your Halo:Reach API Key
|
24
25
|
=> #<Halo::Reach::API:0x1015ec2c8 @token="xxx", @api_url="http://www.bungie.net/api/reach/reachapijson.svc/">
|
25
26
|
|
26
27
|
Look at the unofficial wiki for complete descriptions of the API calls.
|
@@ -29,11 +30,7 @@ Look at the unofficial wiki for complete descriptions of the API calls.
|
|
29
30
|
|
30
31
|
Q: How do I get an API key?
|
31
32
|
|
32
|
-
A: You must
|
33
|
-
|
34
|
-
Q: Can I have your API key?
|
35
|
-
|
36
|
-
A: No. You can subscribe to Bungie Pro and generate an API key for your application.
|
33
|
+
A: You must register with Bungie.net and you can then generate an API key at http://www.bungie.net/Account/reachapikey.aspx
|
37
34
|
|
38
35
|
Q: Dates are funky and not parsed as dates. For example:
|
39
36
|
|
@@ -47,22 +44,6 @@ Q: Dates are funky and not parsed as dates. For example:
|
|
47
44
|
A: Yes they are funky. Yes. They. Are. You can now parse them out with the Halo::Reach::Util class.
|
48
45
|
|
49
46
|
>> parsed_time, parsed_timezone = Halo::Reach::Util::parse_timestamp(api_timestamp)
|
50
|
-
|
51
|
-
== Changelog
|
52
|
-
|
53
|
-
=== 1.0.4
|
54
|
-
|
55
|
-
* Removed explicit version dependencies on supporting development-only libraries
|
56
|
-
* Fixed JSON in tests to not be stupid about null values
|
57
|
-
* Fixed copy-and-paste errors in tests
|
58
|
-
|
59
|
-
=== 1.0.3
|
60
|
-
|
61
|
-
* Fixed some internal Ruby API deprecation warnings
|
62
|
-
|
63
|
-
=== 1.0.2
|
64
|
-
|
65
|
-
* Added set_timeout method to set timeout for HTTP requests
|
66
47
|
|
67
48
|
== Contributing to halo-reach-api
|
68
49
|
|
data/Rakefile
CHANGED
@@ -1,31 +1,7 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'bundler'
|
3
|
-
|
4
|
-
Bundler.setup(:default, :development)
|
5
|
-
rescue Bundler::BundlerError => e
|
6
|
-
$stderr.puts e.message
|
7
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
-
exit e.status_code
|
9
|
-
end
|
10
|
-
require 'rake'
|
11
|
-
|
12
|
-
require 'jeweler'
|
13
|
-
Jeweler::Tasks.new do |gem|
|
14
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
-
gem.name = "halo-reach-api"
|
16
|
-
gem.homepage = "http://github.com/agoragames/halo-reach-api"
|
17
|
-
gem.license = "MIT"
|
18
|
-
gem.summary = %Q{Ruby gem for interacting with the Halo:Reach API}
|
19
|
-
gem.description = %Q{Ruby gem for interacting with the Halo:Reach API}
|
20
|
-
gem.email = "dczarnecki@agoragames.com"
|
21
|
-
gem.authors = ["David Czarnecki"]
|
22
|
-
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
-
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
-
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
25
|
-
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
26
|
-
end
|
27
|
-
Jeweler::RubygemsDotOrgTasks.new
|
2
|
+
Bundler::GemHelper.install_tasks
|
28
3
|
|
4
|
+
require 'rake'
|
29
5
|
require 'rake/testtask'
|
30
6
|
Rake::TestTask.new(:test) do |test|
|
31
7
|
test.libs << 'lib' << 'test'
|
@@ -33,25 +9,8 @@ Rake::TestTask.new(:test) do |test|
|
|
33
9
|
test.verbose = true
|
34
10
|
end
|
35
11
|
|
36
|
-
require 'rcov/rcovtask'
|
37
|
-
Rcov::RcovTask.new do |test|
|
38
|
-
test.libs << 'test'
|
39
|
-
test.pattern = 'test/**/test_*.rb'
|
40
|
-
test.verbose = true
|
41
|
-
end
|
42
|
-
|
43
|
-
require 'rake/rdoctask'
|
44
|
-
Rake::RDocTask.new do |rdoc|
|
45
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
46
|
-
|
47
|
-
rdoc.rdoc_dir = 'rdoc'
|
48
|
-
rdoc.title = "halo-reach-api #{version}"
|
49
|
-
rdoc.rdoc_files.include('README*')
|
50
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
51
|
-
end
|
52
|
-
|
53
12
|
task :default => :test_rubies
|
54
13
|
|
55
14
|
task :test_rubies do
|
56
|
-
system "rvm 1.8.7@halo-reach-api_gem,1.9.2@halo-reach-api_gem rake test"
|
15
|
+
system "rvm 1.8.7@halo-reach-api_gem,1.9.2@halo-reach-api_gem,1.9.3@halo-reach-api_gem do rake test"
|
57
16
|
end
|
data/halo-reach-api.gemspec
CHANGED
@@ -1,79 +1,28 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
5
3
|
|
6
|
-
|
7
|
-
s.name = %q{halo-reach-api}
|
8
|
-
s.version = "1.0.4"
|
4
|
+
require 'version'
|
9
5
|
|
10
|
-
|
11
|
-
s.
|
12
|
-
s.
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "halo-reach-api"
|
8
|
+
s.version = Halo::Reach::API::VERSION.dup
|
9
|
+
s.authors = ["David Czarnecki"]
|
10
|
+
s.email = ["dczarnecki@agoragames.com"]
|
11
|
+
s.homepage = "https://github.com/agoragames/halo-reach-api"
|
12
|
+
s.summary = %q{Ruby gem for interacting with the Halo:Reach API}
|
13
13
|
s.description = %q{Ruby gem for interacting with the Halo:Reach API}
|
14
|
-
|
15
|
-
s.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
s.files
|
20
|
-
".document",
|
21
|
-
".rvmrc",
|
22
|
-
"Gemfile",
|
23
|
-
"LICENSE.txt",
|
24
|
-
"README.rdoc",
|
25
|
-
"Rakefile",
|
26
|
-
"VERSION",
|
27
|
-
"halo-reach-api.gemspec",
|
28
|
-
"lib/halo-reach-api.rb",
|
29
|
-
"lib/halo-reach-util.rb",
|
30
|
-
"test/fakeweb/get_current_challenges.json",
|
31
|
-
"test/fakeweb/get_file_details.json",
|
32
|
-
"test/fakeweb/get_game_details.json",
|
33
|
-
"test/fakeweb/get_game_history.json",
|
34
|
-
"test/fakeweb/get_game_metadata.json",
|
35
|
-
"test/fakeweb/get_player_details_with_no_stats.json",
|
36
|
-
"test/fakeweb/get_player_details_with_stats_by_map.json",
|
37
|
-
"test/fakeweb/get_player_details_with_stats_by_playlist.json",
|
38
|
-
"test/fakeweb/get_player_file_set_files.json",
|
39
|
-
"test/fakeweb/get_player_file_sets.json",
|
40
|
-
"test/fakeweb/get_player_file_share.json",
|
41
|
-
"test/fakeweb/get_player_recent_screenshots.json",
|
42
|
-
"test/fakeweb/get_player_rendered_videos.json",
|
43
|
-
"test/fakeweb/reach_file_search.json",
|
44
|
-
"test/helper.rb",
|
45
|
-
"test/test_halo-reach-api.rb",
|
46
|
-
"test/test_halo-reach-util.rb"
|
47
|
-
]
|
48
|
-
s.homepage = %q{http://github.com/agoragames/halo-reach-api}
|
49
|
-
s.licenses = ["MIT"]
|
14
|
+
|
15
|
+
s.rubyforge_project = "halo-reach-api"
|
16
|
+
|
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) }
|
50
20
|
s.require_paths = ["lib"]
|
51
|
-
s.rubygems_version = %q{1.3.7}
|
52
|
-
s.summary = %q{Ruby gem for interacting with the Halo:Reach API}
|
53
21
|
|
54
|
-
|
55
|
-
|
56
|
-
s.specification_version = 3
|
22
|
+
s.add_dependency('httparty')
|
23
|
+
s.add_dependency('json')
|
57
24
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
s.add_development_dependency(%q<bundler>, [">= 0"])
|
62
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
63
|
-
s.add_development_dependency(%q<rcov>, [">= 0"])
|
64
|
-
else
|
65
|
-
s.add_dependency(%q<httparty>, [">= 0"])
|
66
|
-
s.add_dependency(%q<json>, [">= 0"])
|
67
|
-
s.add_dependency(%q<bundler>, [">= 0"])
|
68
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
69
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
70
|
-
end
|
71
|
-
else
|
72
|
-
s.add_dependency(%q<httparty>, [">= 0"])
|
73
|
-
s.add_dependency(%q<json>, [">= 0"])
|
74
|
-
s.add_dependency(%q<bundler>, [">= 0"])
|
75
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
76
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
77
|
-
end
|
25
|
+
s.add_development_dependency('rake')
|
26
|
+
s.add_development_dependency('fakeweb')
|
27
|
+
s.add_development_dependency('mocha')
|
78
28
|
end
|
79
|
-
|
data/lib/halo-reach-api.rb
CHANGED
@@ -2,12 +2,12 @@ require 'httparty'
|
|
2
2
|
require 'json'
|
3
3
|
require 'cgi'
|
4
4
|
|
5
|
+
require 'version'
|
6
|
+
|
5
7
|
module Halo
|
6
8
|
module Reach
|
7
9
|
class API
|
8
10
|
include HTTParty
|
9
|
-
|
10
|
-
VERSION = '1.0.4'.freeze
|
11
11
|
API_URL = 'http://www.bungie.net/api/reach/reachapijson.svc/'
|
12
12
|
|
13
13
|
DEFAULT_HEADERS = {
|
@@ -21,89 +21,137 @@ module Halo
|
|
21
21
|
attr_accessor :api_url
|
22
22
|
attr_accessor :token
|
23
23
|
|
24
|
+
# Create a new Halo::Reach::API class with your token
|
24
25
|
def initialize(token, api_url = API_URL)
|
25
26
|
@token = token
|
26
27
|
@api_url = api_url
|
27
28
|
end
|
28
29
|
|
30
|
+
# Set a new location for debug output
|
29
31
|
def debug(location = $stderr)
|
30
32
|
self.class.debug_output(location)
|
31
33
|
end
|
32
34
|
|
35
|
+
# Set new HTTP headers
|
33
36
|
def set_http_headers(http_headers = {})
|
34
37
|
http_headers.merge!(DEFAULT_HEADERS)
|
35
38
|
headers(http_headers)
|
36
39
|
end
|
37
40
|
|
41
|
+
# Set a new default HTTP timeout
|
38
42
|
def set_timeout(timeout)
|
39
43
|
default_timeout(timeout)
|
40
44
|
end
|
41
45
|
|
46
|
+
# The "GetGameMetadata" method returns several dictionaries so that resource ids can be translated into their more detailed versions.
|
47
|
+
# For example, this method can be used to associate a medal resource id with its representative medal (say, a killing spree).
|
48
|
+
#
|
49
|
+
# http://www.haloreachapi.net/wiki/GetGameMetadata
|
42
50
|
def get_game_metadata
|
43
51
|
game_metadata_uri = "game/metadata/#{@token}"
|
44
52
|
self.class.get(@api_url + game_metadata_uri)
|
45
53
|
end
|
46
|
-
|
54
|
+
|
55
|
+
# The "GetCurrentChallenges" method returns the currently active weekly and daily challenges.
|
56
|
+
#
|
57
|
+
# http://www.haloreachapi.net/wiki/GetCurrentChallenges
|
47
58
|
def get_current_challenges
|
48
59
|
current_challenges_uri = "game/challenges/#{@token}"
|
49
60
|
self.class.get(@api_url + current_challenges_uri)
|
50
61
|
end
|
51
62
|
|
63
|
+
# The "GetGameDetails" method returns detailed information for a given game ID.
|
64
|
+
#
|
65
|
+
# http://www.haloreachapi.net/wiki/GetGameDetails
|
52
66
|
def get_game_details(game_id)
|
53
67
|
get_game_details_uri = "game/details/#{@token}/#{game_id}"
|
54
68
|
self.class.get(@api_url + get_game_details_uri)
|
55
69
|
end
|
56
70
|
|
71
|
+
# The "GetGameHistory" method returns a players list of games, in chronological reverse over. Returned games is paginated,
|
72
|
+
# and you can specific which game variant, (Invasion, Campaign, for example), or Unknown for all games.
|
73
|
+
#
|
74
|
+
# http://www.haloreachapi.net/wiki/GetGameHistory
|
57
75
|
def get_game_history(gamertag, variant_class = 'Unknown', page = 0)
|
58
|
-
get_game_history_uri = "player/gamehistory/#{@token}/#{
|
76
|
+
get_game_history_uri = "player/gamehistory/#{@token}/#{msftize(gamertag)}/#{variant_class}/#{page}"
|
59
77
|
self.class.get(@api_url + get_game_history_uri)
|
60
78
|
end
|
61
79
|
|
80
|
+
# Undocumented
|
81
|
+
#
|
82
|
+
# http://www.haloreachapi.net/wiki/GetPlayerDetailsWithStatsByMap
|
62
83
|
def get_player_details_with_stats_by_map(gamertag)
|
63
|
-
get_player_details_with_stats_by_map_uri = "player/details/bymap/#{@token}/#{
|
84
|
+
get_player_details_with_stats_by_map_uri = "player/details/bymap/#{@token}/#{msftize(gamertag)}"
|
64
85
|
self.class.get(@api_url + get_player_details_with_stats_by_map_uri)
|
65
86
|
end
|
66
87
|
|
88
|
+
# The "GetPlayerDetailsWithStatsByPlaylist" method Returns detailed aggregate information on a player, including arena information.
|
89
|
+
#
|
90
|
+
# http://www.haloreachapi.net/wiki/GetPlayerDetailsWithStatsByPlaylist
|
67
91
|
def get_player_details_with_stats_by_playlist(gamertag)
|
68
|
-
get_player_details_with_stats_by_playlist_uri = "player/details/byplaylist/#{@token}/#{
|
92
|
+
get_player_details_with_stats_by_playlist_uri = "player/details/byplaylist/#{@token}/#{msftize(gamertag)}"
|
69
93
|
self.class.get(@api_url + get_player_details_with_stats_by_playlist_uri)
|
70
94
|
end
|
71
95
|
|
96
|
+
# The "GetPlayerDetailsWithNoStats" method returns basic information about a player.
|
97
|
+
#
|
98
|
+
# http://www.haloreachapi.net/wiki/GetPlayerDetailsWithNoStats
|
72
99
|
def get_player_details_with_no_stats(gamertag)
|
73
|
-
get_player_details_with_no_stats_uri = "player/details/nostats/#{@token}/#{
|
100
|
+
get_player_details_with_no_stats_uri = "player/details/nostats/#{@token}/#{msftize(gamertag)}"
|
74
101
|
self.class.get(@api_url + get_player_details_with_no_stats_uri)
|
75
102
|
end
|
76
103
|
|
104
|
+
# The "GetPlayerFileShare" method returns a listing of files in a player's file share.
|
105
|
+
#
|
106
|
+
# http://www.haloreachapi.net/wiki/GetPlayerFileShare
|
77
107
|
def get_player_file_share(gamertag)
|
78
|
-
get_player_file_share_uri = "file/share/#{@token}/#{
|
108
|
+
get_player_file_share_uri = "file/share/#{@token}/#{msftize(gamertag)}"
|
79
109
|
self.class.get(@api_url + get_player_file_share_uri)
|
80
110
|
end
|
81
111
|
|
112
|
+
# The "GetFileDetails" method returns the file details for a single file.
|
113
|
+
#
|
114
|
+
# http://www.haloreachapi.net/wiki/GetFileDetails
|
82
115
|
def get_file_details(file_id)
|
83
116
|
get_file_details_uri = "file/details/#{@token}/#{file_id}"
|
84
117
|
self.class.get(@api_url + get_file_details_uri)
|
85
118
|
end
|
86
119
|
|
120
|
+
# The "GetPlayerRecentScreenshots" method returns a list of the player's recent screenshots.
|
121
|
+
#
|
122
|
+
# http://www.haloreachapi.net/wiki/GetPlayerRecentScreenshots
|
87
123
|
def get_player_recent_screenshots(gamertag)
|
88
|
-
get_player_recent_screenshots_uri = "file/screenshots/#{@token}/#{
|
124
|
+
get_player_recent_screenshots_uri = "file/screenshots/#{@token}/#{msftize(gamertag)}"
|
89
125
|
self.class.get(@api_url + get_player_recent_screenshots_uri)
|
90
126
|
end
|
91
127
|
|
128
|
+
# The "GetPlayerFileSets" method returns a listing of file sets created by the player.
|
129
|
+
#
|
130
|
+
# http://www.haloreachapi.net/wiki/GetPlayerFileSets
|
92
131
|
def get_player_file_sets(gamertag)
|
93
|
-
get_player_file_sets_uri = "file/sets/#{@token}/#{
|
132
|
+
get_player_file_sets_uri = "file/sets/#{@token}/#{msftize(gamertag)}"
|
94
133
|
self.class.get(@api_url + get_player_file_sets_uri)
|
95
134
|
end
|
96
135
|
|
136
|
+
# The "GetPlayerFileSetFiles" method returns a listing of files in the specified file set.
|
137
|
+
#
|
138
|
+
# http://www.haloreachapi.net/wiki/GetPlayerFileSetFiles
|
97
139
|
def get_player_file_set_files(gamertag, file_set_id)
|
98
|
-
get_player_file_set_files_uri = "file/sets/files/#{@token}/#{
|
140
|
+
get_player_file_set_files_uri = "file/sets/files/#{@token}/#{msftize(gamertag)}/#{file_set_id}"
|
99
141
|
self.class.get(@api_url + get_player_file_set_files_uri)
|
100
142
|
end
|
101
|
-
|
143
|
+
|
144
|
+
# The "GetPlayerRenderedVideos" method returns a listing of rendered videos created by a player.
|
145
|
+
#
|
146
|
+
# http://www.haloreachapi.net/wiki/GetPlayerRenderedVideos
|
102
147
|
def get_player_rendered_videos(gamertag, page = 0)
|
103
|
-
get_player_rendered_videos_uri = "file/videos/#{@token}/#{
|
148
|
+
get_player_rendered_videos_uri = "file/videos/#{@token}/#{msftize(gamertag)}/#{page}"
|
104
149
|
self.class.get(@api_url + get_player_rendered_videos_uri)
|
105
150
|
end
|
106
|
-
|
151
|
+
|
152
|
+
# The "ReachFileSearch" method returns a listing of files matching the specified criteria.
|
153
|
+
#
|
154
|
+
# http://www.haloreachapi.net/wiki/ReachFileSearch
|
107
155
|
def reach_file_search(file_category, map_filter, engine_filter, date_filter, sort_filter, tags, page = 0)
|
108
156
|
reach_file_search_uri = "file/search/#{@token}/#{file_category}/#{map_filter}/#{engine_filter}/#{date_filter}/#{sort_filter}/#{page}"
|
109
157
|
unless tags.nil?
|
@@ -112,6 +160,13 @@ module Halo
|
|
112
160
|
|
113
161
|
self.class.get(@api_url + reach_file_search_uri)
|
114
162
|
end
|
163
|
+
|
164
|
+
private
|
165
|
+
|
166
|
+
# MSFT servers are not able to parse the '+' if doing a straight CGI.escape
|
167
|
+
def msftize(gamertag)
|
168
|
+
gamertag.gsub(' ', '%20')
|
169
|
+
end
|
115
170
|
end
|
116
171
|
end
|
117
172
|
end
|
data/lib/version.rb
ADDED
data/test/test_halo-reach-api.rb
CHANGED
metadata
CHANGED
@@ -1,119 +1,90 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: halo-reach-api
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 4
|
10
|
-
segments_generated: true
|
11
|
-
version: 1.0.4
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.5
|
5
|
+
prerelease:
|
12
6
|
platform: ruby
|
13
|
-
authors:
|
7
|
+
authors:
|
14
8
|
- David Czarnecki
|
15
9
|
autorequire:
|
16
10
|
bindir: bin
|
17
11
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
12
|
+
date: 2011-11-25 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
25
15
|
name: httparty
|
26
|
-
|
16
|
+
requirement: &2152303760 !ruby/object:Gem::Requirement
|
27
17
|
none: false
|
28
|
-
requirements:
|
29
|
-
- -
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
|
32
|
-
segments:
|
33
|
-
- 0
|
34
|
-
segments_generated: true
|
35
|
-
version: "0"
|
36
|
-
requirement: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
38
22
|
type: :runtime
|
39
23
|
prerelease: false
|
24
|
+
version_requirements: *2152303760
|
25
|
+
- !ruby/object:Gem::Dependency
|
40
26
|
name: json
|
41
|
-
|
27
|
+
requirement: &2152303300 !ruby/object:Gem::Requirement
|
42
28
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
|
47
|
-
|
48
|
-
- 0
|
49
|
-
segments_generated: true
|
50
|
-
version: "0"
|
51
|
-
requirement: *id002
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
type: :development
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
54
34
|
prerelease: false
|
55
|
-
|
56
|
-
|
35
|
+
version_requirements: *2152303300
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rake
|
38
|
+
requirement: &2152302720 !ruby/object:Gem::Requirement
|
57
39
|
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
segments:
|
63
|
-
- 0
|
64
|
-
segments_generated: true
|
65
|
-
version: "0"
|
66
|
-
requirement: *id003
|
67
|
-
- !ruby/object:Gem::Dependency
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
68
44
|
type: :development
|
69
45
|
prerelease: false
|
70
|
-
|
71
|
-
|
46
|
+
version_requirements: *2152302720
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: fakeweb
|
49
|
+
requirement: &2152302280 !ruby/object:Gem::Requirement
|
72
50
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
segments:
|
78
|
-
- 0
|
79
|
-
segments_generated: true
|
80
|
-
version: "0"
|
81
|
-
requirement: *id004
|
82
|
-
- !ruby/object:Gem::Dependency
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
83
55
|
type: :development
|
84
56
|
prerelease: false
|
85
|
-
|
86
|
-
|
57
|
+
version_requirements: *2152302280
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: mocha
|
60
|
+
requirement: &2152301800 !ruby/object:Gem::Requirement
|
87
61
|
none: false
|
88
|
-
requirements:
|
89
|
-
- -
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
version: "0"
|
96
|
-
requirement: *id005
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *2152301800
|
97
69
|
description: Ruby gem for interacting with the Halo:Reach API
|
98
|
-
email:
|
70
|
+
email:
|
71
|
+
- dczarnecki@agoragames.com
|
99
72
|
executables: []
|
100
|
-
|
101
73
|
extensions: []
|
102
|
-
|
103
|
-
|
104
|
-
- LICENSE.txt
|
105
|
-
- README.rdoc
|
106
|
-
files:
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
107
76
|
- .document
|
77
|
+
- .gitignore
|
108
78
|
- .rvmrc
|
79
|
+
- CHANGELOG.md
|
109
80
|
- Gemfile
|
110
81
|
- LICENSE.txt
|
111
82
|
- README.rdoc
|
112
83
|
- Rakefile
|
113
|
-
- VERSION
|
114
84
|
- halo-reach-api.gemspec
|
115
85
|
- lib/halo-reach-api.rb
|
116
86
|
- lib/halo-reach-util.rb
|
87
|
+
- lib/version.rb
|
117
88
|
- test/fakeweb/get_current_challenges.json
|
118
89
|
- test/fakeweb/get_file_details.json
|
119
90
|
- test/fakeweb/get_game_details.json
|
@@ -131,41 +102,45 @@ files:
|
|
131
102
|
- test/helper.rb
|
132
103
|
- test/test_halo-reach-api.rb
|
133
104
|
- test/test_halo-reach-util.rb
|
134
|
-
|
135
|
-
|
136
|
-
licenses:
|
137
|
-
- MIT
|
105
|
+
homepage: https://github.com/agoragames/halo-reach-api
|
106
|
+
licenses: []
|
138
107
|
post_install_message:
|
139
108
|
rdoc_options: []
|
140
|
-
|
141
|
-
require_paths:
|
109
|
+
require_paths:
|
142
110
|
- lib
|
143
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
144
112
|
none: false
|
145
|
-
requirements:
|
146
|
-
- -
|
147
|
-
- !ruby/object:Gem::Version
|
148
|
-
|
149
|
-
|
150
|
-
- 0
|
151
|
-
segments_generated: true
|
152
|
-
version: "0"
|
153
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ! '>='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
118
|
none: false
|
155
|
-
requirements:
|
156
|
-
- -
|
157
|
-
- !ruby/object:Gem::Version
|
158
|
-
|
159
|
-
segments:
|
160
|
-
- 0
|
161
|
-
segments_generated: true
|
162
|
-
version: "0"
|
119
|
+
requirements:
|
120
|
+
- - ! '>='
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
163
123
|
requirements: []
|
164
|
-
|
165
|
-
|
166
|
-
rubygems_version: 1.3.7
|
124
|
+
rubyforge_project: halo-reach-api
|
125
|
+
rubygems_version: 1.8.10
|
167
126
|
signing_key:
|
168
127
|
specification_version: 3
|
169
128
|
summary: Ruby gem for interacting with the Halo:Reach API
|
170
|
-
test_files:
|
171
|
-
|
129
|
+
test_files:
|
130
|
+
- test/fakeweb/get_current_challenges.json
|
131
|
+
- test/fakeweb/get_file_details.json
|
132
|
+
- test/fakeweb/get_game_details.json
|
133
|
+
- test/fakeweb/get_game_history.json
|
134
|
+
- test/fakeweb/get_game_metadata.json
|
135
|
+
- test/fakeweb/get_player_details_with_no_stats.json
|
136
|
+
- test/fakeweb/get_player_details_with_stats_by_map.json
|
137
|
+
- test/fakeweb/get_player_details_with_stats_by_playlist.json
|
138
|
+
- test/fakeweb/get_player_file_set_files.json
|
139
|
+
- test/fakeweb/get_player_file_sets.json
|
140
|
+
- test/fakeweb/get_player_file_share.json
|
141
|
+
- test/fakeweb/get_player_recent_screenshots.json
|
142
|
+
- test/fakeweb/get_player_rendered_videos.json
|
143
|
+
- test/fakeweb/reach_file_search.json
|
144
|
+
- test/helper.rb
|
145
|
+
- test/test_halo-reach-api.rb
|
146
|
+
- test/test_halo-reach-util.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.0.4
|