blizzard_api 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +21 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +9 -9
- data/README.md +1 -3
- data/blizzard_api.gemspec +6 -4
- data/lib/blizzard_api/request.rb +1 -1
- data/lib/blizzard_api/starcraft.rb +7 -0
- data/lib/blizzard_api/starcraft/community/legacy.rb +88 -0
- data/lib/blizzard_api/version.rb +1 -1
- metadata +11 -8
- data/.gitlab-ci.yml +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf8d2354d8c5693db38cc06fb9a531ea3088c2ef03df14de07369e7b3bf30e3b
|
4
|
+
data.tar.gz: 05fd0395084f152722138b93bed892ceb5cbb826563aae96830b5f4d85acfd0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcc914e44f283a236eccd316601f175925d0304b34a6dae3dd5a69c5c441cbd5b8f7ba9e7f4b1080375a7b53f82bb93e5e273deedeba1586e612ea7eb6368066
|
7
|
+
data.tar.gz: 5a28789fa6f1839f4a81a8de96756a6d8b7a6ae5ae7c25f9b6f9747f4acd9fd0e7a762ed29f0578465141a278510bf7a211308e4701c1aca1f6d16b8d53bd600
|
@@ -0,0 +1,21 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: push
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- uses: actions/checkout@v2
|
10
|
+
- name: Set up Ruby
|
11
|
+
uses: ruby/setup-ruby@21351ecc0a7c196081abca5dc55b08f085efe09a
|
12
|
+
with:
|
13
|
+
ruby-version: 2.6
|
14
|
+
- name: Install dependencies
|
15
|
+
run: bundle install
|
16
|
+
- name: Run tests
|
17
|
+
run: bundle exec rake
|
18
|
+
env:
|
19
|
+
BNET_APPLICATION_ID: ${{ secrets.BNET_APPLICATION_ID }}
|
20
|
+
BNET_APPLICATION_SECRET: ${{ secrets.BNET_APPLICATION_SECRET }}
|
21
|
+
USE_CACHE: false
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
Please view this file on the master branch, otherwise it may be outdated
|
2
2
|
|
3
|
+
**Version 0.5.3**
|
4
|
+
|
5
|
+
Added missing legacy SC2 endpoints
|
6
|
+
|
7
|
+
See https://github.com/francis-schiavo/blizzard_api/pull/2
|
8
|
+
|
3
9
|
**Version 0.5.2**
|
4
10
|
|
5
11
|
Added new endpoints: https://us.forums.blizzard.com/en/blizzard/t/wow-shadowlands-api-update-covenenats-soulbinds-more/13385
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
blizzard_api (0.5.
|
4
|
+
blizzard_api (0.5.2)
|
5
5
|
redis (~> 4.1, >= 4.1.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -10,24 +10,24 @@ GEM
|
|
10
10
|
ast (2.4.1)
|
11
11
|
dotenv (2.7.6)
|
12
12
|
minitest (5.14.2)
|
13
|
-
parallel (1.
|
14
|
-
parser (2.7.
|
13
|
+
parallel (1.20.1)
|
14
|
+
parser (2.7.2.0)
|
15
15
|
ast (~> 2.4.1)
|
16
16
|
rainbow (3.0.0)
|
17
17
|
rake (13.0.1)
|
18
|
-
redis (4.2.
|
19
|
-
regexp_parser (
|
18
|
+
redis (4.2.5)
|
19
|
+
regexp_parser (2.0.0)
|
20
20
|
rexml (3.2.4)
|
21
|
-
rubocop (0.
|
21
|
+
rubocop (0.93.1)
|
22
22
|
parallel (~> 1.10)
|
23
23
|
parser (>= 2.7.1.5)
|
24
24
|
rainbow (>= 2.2.2, < 4.0)
|
25
|
-
regexp_parser (>= 1.
|
25
|
+
regexp_parser (>= 1.8)
|
26
26
|
rexml
|
27
|
-
rubocop-ast (>= 0.
|
27
|
+
rubocop-ast (>= 0.6.0)
|
28
28
|
ruby-progressbar (~> 1.7)
|
29
29
|
unicode-display_width (>= 1.4.0, < 2.0)
|
30
|
-
rubocop-ast (
|
30
|
+
rubocop-ast (1.3.0)
|
31
31
|
parser (>= 2.7.1.5)
|
32
32
|
ruby-progressbar (1.10.1)
|
33
33
|
unicode-display_width (1.7.0)
|
data/README.md
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
# Blizzard Api
|
2
2
|
|
3
|
-
[![pipeline status](https://gitlab.com/francisschiavo/blizzard_api/badges/master/pipeline.svg)](https://gitlab.com/francisschiavo/blizzard_api/commits/master)
|
4
3
|
[![Gem Version](https://badge.fury.io/rb/blizzard_api.svg)](https://badge.fury.io/rb/blizzard_api)
|
5
4
|
|
6
|
-
|
7
5
|
This gem allow you to interface with the new blizzard api (2018) using the OAuth2 protocol for every request.
|
8
6
|
|
9
7
|
**Important**: This gem does not support, nor will support China endpoints.
|
@@ -351,7 +349,7 @@ Every endpoint requiring a *region_id* parameter will accepts either the integer
|
|
351
349
|
|
352
350
|
## Contributing
|
353
351
|
|
354
|
-
Bug reports and pull requests are welcome on
|
352
|
+
Bug reports and pull requests are welcome on Github at https://github.com/francis-schiavo/blizzard_api/issues
|
355
353
|
|
356
354
|
## License
|
357
355
|
|
data/blizzard_api.gemspec
CHANGED
@@ -9,10 +9,10 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.name = 'blizzard_api'
|
10
10
|
spec.version = BlizzardApi::VERSION
|
11
11
|
spec.authors = ['Francis Schiavo']
|
12
|
-
spec.email = ['francis
|
12
|
+
spec.email = ['francis@schiavo.dev']
|
13
13
|
spec.summary = 'Unofficial Ruby client for Blizzard Entertainment API'
|
14
14
|
spec.description = 'This is a simple interface to obtain data from Blizzard API'
|
15
|
-
spec.homepage = 'https://
|
15
|
+
spec.homepage = 'https://github.com/francis-schiavo/blizzard_api'
|
16
16
|
spec.license = 'MIT'
|
17
17
|
|
18
18
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
@@ -20,8 +20,10 @@ Gem::Specification.new do |spec|
|
|
20
20
|
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.' unless spec.respond_to?(:metadata)
|
21
21
|
|
22
22
|
spec.metadata['homepage_uri'] = spec.homepage
|
23
|
-
spec.metadata['source_code_uri'] = 'https://
|
24
|
-
spec.metadata['
|
23
|
+
spec.metadata['source_code_uri'] = 'https://github.com/francis-schiavo/blizzard_api'
|
24
|
+
spec.metadata['bug_tracker_uri'] = 'https://github.com/francis-schiavo/blizzard_api/issues'
|
25
|
+
spec.metadata['changelog_uri'] = 'https://github.com/francis-schiavo/blizzard_api/blob/master/CHANGELOG.md'
|
26
|
+
spec.metadata['documentation_uri'] = 'https://rubydoc.info/gems/blizzard_api'
|
25
27
|
|
26
28
|
# Specify which files should be added to the gem when it is released.
|
27
29
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
data/lib/blizzard_api/request.rb
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
|
18
18
|
##
|
19
19
|
# @!macro [new] response
|
20
|
-
# @return [
|
20
|
+
# @return [Hash] API Response. The actual type of the returned object depends on the *format* option
|
21
21
|
# in the configuration module
|
22
22
|
|
23
23
|
##
|
@@ -19,6 +19,7 @@ module BlizzardApi
|
|
19
19
|
require_relative 'starcraft/community/profile'
|
20
20
|
require_relative 'starcraft/community/ladder'
|
21
21
|
require_relative 'starcraft/community/account'
|
22
|
+
require_relative 'starcraft/community/legacy'
|
22
23
|
|
23
24
|
##
|
24
25
|
# @param region [String] API Region
|
@@ -40,5 +41,11 @@ module BlizzardApi
|
|
40
41
|
def self.account(region = BlizzardApi.region)
|
41
42
|
BlizzardApi::Starcraft::Account.new(region)
|
42
43
|
end
|
44
|
+
|
45
|
+
##
|
46
|
+
# @return {Legacy}
|
47
|
+
def self.legacy
|
48
|
+
BlizzardApi::Starcraft::Legacy.new
|
49
|
+
end
|
43
50
|
end
|
44
51
|
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module BlizzardApi
|
4
|
+
module Starcraft
|
5
|
+
##
|
6
|
+
# This class allows access to Starcraft II legacy data
|
7
|
+
#
|
8
|
+
# @see https://develop.battle.net/documentation/api-reference/starcraft-2-game-data-api
|
9
|
+
#
|
10
|
+
# You can get an instance of this class using the default region as follows:
|
11
|
+
# api_instance = BlizzardApi::Starcraft.legacy
|
12
|
+
class Legacy < Starcraft::Request
|
13
|
+
|
14
|
+
##
|
15
|
+
# Profile data
|
16
|
+
#
|
17
|
+
# @!macro sc2_regions
|
18
|
+
# @param [Integer] realm_id Realm ID
|
19
|
+
# @param [Integer] profile_id Profile ID
|
20
|
+
# @!macro request_options
|
21
|
+
def profile(region_id, realm_id, profile_id, options = {})
|
22
|
+
reg = resolve_region(region_id)
|
23
|
+
opts = { ttl: CACHE_DAY }.merge(options)
|
24
|
+
api_request "#{base_url(:community)}/legacy/profile/#{reg}/#{realm_id}/#{profile_id}", opts
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
# Ladders
|
29
|
+
#
|
30
|
+
# @!macro sc2_regions
|
31
|
+
# @param [Integer] realm_id Realm ID
|
32
|
+
# @param [Integer] profile_id Profile ID
|
33
|
+
# @!macro request_options
|
34
|
+
def ladders(region_id, realm_id, profile_id, options = {})
|
35
|
+
reg = resolve_region(region_id)
|
36
|
+
opts = { ttl: CACHE_DAY }.merge(options)
|
37
|
+
api_request "#{base_url(:community)}/legacy/profile/#{reg}/#{realm_id}/#{profile_id}/ladder ", opts
|
38
|
+
end
|
39
|
+
|
40
|
+
##
|
41
|
+
# Match History
|
42
|
+
#
|
43
|
+
# @!macro sc2_regions
|
44
|
+
# @param [Integer] realm_id Realm ID
|
45
|
+
# @param [Integer] profile_id Profile ID
|
46
|
+
# @!macro request_options
|
47
|
+
def match(region_id, realm_id, profile_id, options = {})
|
48
|
+
reg = resolve_region(region_id)
|
49
|
+
opts = { ttl: CACHE_DAY }.merge(options)
|
50
|
+
api_request "#{base_url(:community)}/legacy/profile/#{reg}/#{realm_id}/#{profile_id}/matches", opts
|
51
|
+
end
|
52
|
+
|
53
|
+
##
|
54
|
+
# Ladder
|
55
|
+
#
|
56
|
+
# @!macro sc2_regions
|
57
|
+
# @param [Integer] ladder_id Ladder ID
|
58
|
+
# @!macro request_options
|
59
|
+
def ladder(region_id, ladder_id, options = {})
|
60
|
+
reg = resolve_region(region_id)
|
61
|
+
opts = { ttl: CACHE_DAY }.merge(options)
|
62
|
+
api_request "#{base_url(:community)}/legacy/ladder/#{reg}/#{ladder_id}", opts
|
63
|
+
end
|
64
|
+
|
65
|
+
##
|
66
|
+
# Achievement data
|
67
|
+
#
|
68
|
+
# @!macro sc2_regions
|
69
|
+
# @!macro request_options
|
70
|
+
def achievements(region_id, options = {})
|
71
|
+
reg = resolve_region(region_id)
|
72
|
+
opts = { ttl: CACHE_DAY }.merge(options)
|
73
|
+
api_request "#{base_url(:community)}/legacy/data/achievements/#{reg}", opts
|
74
|
+
end
|
75
|
+
|
76
|
+
##
|
77
|
+
# Rewards data
|
78
|
+
#
|
79
|
+
# @!macro sc2_regions
|
80
|
+
# @!macro request_options
|
81
|
+
def rewards(region_id, options = {})
|
82
|
+
reg = resolve_region(region_id)
|
83
|
+
opts = { ttl: CACHE_DAY }.merge(options)
|
84
|
+
api_request "#{base_url(:community)}/legacy/data/rewards/#{reg}", opts
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
data/lib/blizzard_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blizzard_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francis Schiavo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -102,13 +102,13 @@ dependencies:
|
|
102
102
|
version: '0'
|
103
103
|
description: This is a simple interface to obtain data from Blizzard API
|
104
104
|
email:
|
105
|
-
- francis
|
105
|
+
- francis@schiavo.dev
|
106
106
|
executables: []
|
107
107
|
extensions: []
|
108
108
|
extra_rdoc_files: []
|
109
109
|
files:
|
110
|
+
- ".github/workflows/ruby.yml"
|
110
111
|
- ".gitignore"
|
111
|
-
- ".gitlab-ci.yml"
|
112
112
|
- ".rubocop.yml"
|
113
113
|
- ".rubocop_todo.yml"
|
114
114
|
- CHANGELOG.md
|
@@ -146,6 +146,7 @@ files:
|
|
146
146
|
- lib/blizzard_api/starcraft.rb
|
147
147
|
- lib/blizzard_api/starcraft/community/account.rb
|
148
148
|
- lib/blizzard_api/starcraft/community/ladder.rb
|
149
|
+
- lib/blizzard_api/starcraft/community/legacy.rb
|
149
150
|
- lib/blizzard_api/starcraft/community/profile.rb
|
150
151
|
- lib/blizzard_api/starcraft/game_data/league.rb
|
151
152
|
- lib/blizzard_api/starcraft/request.rb
|
@@ -192,13 +193,15 @@ files:
|
|
192
193
|
- lib/blizzard_api/wow/search/search_composer.rb
|
193
194
|
- lib/blizzard_api/wow/search/search_request.rb
|
194
195
|
- lib/blizzard_api/wow/slug.rb
|
195
|
-
homepage: https://
|
196
|
+
homepage: https://github.com/francis-schiavo/blizzard_api
|
196
197
|
licenses:
|
197
198
|
- MIT
|
198
199
|
metadata:
|
199
|
-
homepage_uri: https://
|
200
|
-
source_code_uri: https://
|
201
|
-
|
200
|
+
homepage_uri: https://github.com/francis-schiavo/blizzard_api
|
201
|
+
source_code_uri: https://github.com/francis-schiavo/blizzard_api
|
202
|
+
bug_tracker_uri: https://github.com/francis-schiavo/blizzard_api/issues
|
203
|
+
changelog_uri: https://github.com/francis-schiavo/blizzard_api/blob/master/CHANGELOG.md
|
204
|
+
documentation_uri: https://rubydoc.info/gems/blizzard_api
|
202
205
|
post_install_message:
|
203
206
|
rdoc_options: []
|
204
207
|
require_paths:
|