Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Francis
Blizzard api
Commits
86e0dc38
Commit
86e0dc38
authored
Oct 02, 2019
by
Francis
Browse files
Added new WoW endpoints and deprecated WoW community endpoints
parent
dbe430bf
Pipeline
#86164046
passed with stage
in 5 minutes and 11 seconds
Changes
19
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
209 additions
and
23 deletions
+209
-23
CHANGELOG.md
CHANGELOG.md
+15
-0
Gemfile.lock
Gemfile.lock
+1
-1
README.md
README.md
+11
-1
lib/blizzard_api/version.rb
lib/blizzard_api/version.rb
+1
-1
lib/blizzard_api/wow.rb
lib/blizzard_api/wow.rb
+14
-0
lib/blizzard_api/wow/community/auction.rb
lib/blizzard_api/wow/community/auction.rb
+2
-0
lib/blizzard_api/wow/community/boss.rb
lib/blizzard_api/wow/community/boss.rb
+2
-0
lib/blizzard_api/wow/community/challenge.rb
lib/blizzard_api/wow/community/challenge.rb
+2
-0
lib/blizzard_api/wow/community/pvp.rb
lib/blizzard_api/wow/community/pvp.rb
+2
-0
lib/blizzard_api/wow/community/quest.rb
lib/blizzard_api/wow/community/quest.rb
+2
-0
lib/blizzard_api/wow/community/recipe.rb
lib/blizzard_api/wow/community/recipe.rb
+2
-0
lib/blizzard_api/wow/community/spell.rb
lib/blizzard_api/wow/community/spell.rb
+2
-0
lib/blizzard_api/wow/community/zone.rb
lib/blizzard_api/wow/community/zone.rb
+2
-0
lib/blizzard_api/wow/game_data/creature.rb
lib/blizzard_api/wow/game_data/creature.rb
+1
-1
lib/blizzard_api/wow/game_data/reputation_faction.rb
lib/blizzard_api/wow/game_data/reputation_faction.rb
+23
-0
lib/blizzard_api/wow/game_data/reputation_tier.rb
lib/blizzard_api/wow/game_data/reputation_tier.rb
+23
-0
lib/blizzard_api/wow/profile/character_profile.rb
lib/blizzard_api/wow/profile/character_profile.rb
+58
-19
test/blizzard/wow/game_data/reputation_faction_test.rb
test/blizzard/wow/game_data/reputation_faction_test.rb
+23
-0
test/blizzard/wow/game_data/reputation_tier_test.rb
test/blizzard/wow/game_data/reputation_tier_test.rb
+23
-0
No files found.
CHANGELOG.md
View file @
86e0dc38
Please view this file on the master branch, otherwise it may be outdated
**Version 0.2.9**
https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-api-update-collections-hunter-pets-and-reputations/757
*
Added new character endpoints:
*
reputations
*
hunter-pets
*
collections
*
pets
*
mounts
*
Added new endpoints:
*
reputation-tiers
*
reputation-faction
*
Marked all WoW community endpoints as deprecated: https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
**Version 0.2.8**
*
Added the new character status endpoint
...
...
Gemfile.lock
View file @
86e0dc38
PATH
remote: .
specs:
blizzard_api (0.2.
7
)
blizzard_api (0.2.
9
)
redis (~> 4.1, >= 4.1.0)
GEM
...
...
README.md
View file @
86e0dc38
...
...
@@ -195,6 +195,12 @@ Most **data** endpoints will have always 3 methods available `index`, `get` and
-
index
-
get :id
-
media :id
*
Blizzard::Wow::ReputationTier
-
index
-
get :id
*
Blizzard::Wow::ReputationFaction
-
index
-
get :id
*
Blizzard::Wow::Auction
-
get :realm
...
...
@@ -237,7 +243,11 @@ Most **data** endpoints will have always 3 methods available `index`, `get` and
-
titles :realm, :character
-
mythic_keystone_profile :realm, :character
-
mythic_keystone_seasons :realm, :character
-
collections :realm, :character (Not active yet on Blizzard servers)
-
collections :realm, :character
-
pets :realm, :character
-
mounts :realm, :character
-
hunter_pets :realm, :character
-
reputations :realm, :character
-
raid_progression :realm, :character (Not active yet on Blizzard servers)
### 4.2. Diablo III endpoints
...
...
lib/blizzard_api/version.rb
View file @
86e0dc38
...
...
@@ -2,5 +2,5 @@
module
BlizzardApi
# Gem version
VERSION
=
'0.2.
7
'
VERSION
=
'0.2.
9
'
end
lib/blizzard_api/wow.rb
View file @
86e0dc38
...
...
@@ -30,6 +30,8 @@ module BlizzardApi
require_relative
'wow/game_data/title'
require_relative
'wow/game_data/item'
require_relative
'wow/game_data/azerite_essence'
require_relative
'wow/game_data/reputation_tier'
require_relative
'wow/game_data/reputation_faction'
##
# @return {Achievement}
...
...
@@ -169,6 +171,18 @@ module BlizzardApi
BlizzardApi
::
Wow
::
AzeriteEssence
.
new
end
##
# @return {ReputationTier}
def
self
.
reputation_tier
BlizzardApi
::
Wow
::
ReputationTier
.
new
end
##
# @return {ReputationFaction}
def
self
.
reputation_faction
BlizzardApi
::
Wow
::
ReputationFaction
.
new
end
# Wow community api
require_relative
'wow/community/auction'
require_relative
'wow/community/boss'
...
...
lib/blizzard_api/wow/community/auction.rb
View file @
86e0dc38
...
...
@@ -5,6 +5,8 @@ module BlizzardApi
##
# This class allows access to World of Warcraft auctions
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# You can get an instance of this class using the default region as follows:
...
...
lib/blizzard_api/wow/community/boss.rb
View file @
86e0dc38
...
...
@@ -7,6 +7,8 @@ module BlizzardApi
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.boss
class
Boss
<
Wow
::
Request
...
...
lib/blizzard_api/wow/community/challenge.rb
View file @
86e0dc38
...
...
@@ -7,6 +7,8 @@ module BlizzardApi
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.challenge
class
Challenge
<
Wow
::
Request
...
...
lib/blizzard_api/wow/community/pvp.rb
View file @
86e0dc38
...
...
@@ -7,6 +7,8 @@ module BlizzardApi
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.pvp
class
PvP
<
Wow
::
Request
...
...
lib/blizzard_api/wow/community/quest.rb
View file @
86e0dc38
...
...
@@ -7,6 +7,8 @@ module BlizzardApi
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.quest
class
Quest
<
Wow
::
Request
...
...
lib/blizzard_api/wow/community/recipe.rb
View file @
86e0dc38
...
...
@@ -7,6 +7,8 @@ module BlizzardApi
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.recipe
class
Recipe
<
Wow
::
Request
...
...
lib/blizzard_api/wow/community/spell.rb
View file @
86e0dc38
...
...
@@ -7,6 +7,8 @@ module BlizzardApi
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.spell
class
Spell
<
Wow
::
Request
...
...
lib/blizzard_api/wow/community/zone.rb
View file @
86e0dc38
...
...
@@ -7,6 +7,8 @@ module BlizzardApi
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.zone
class
Zone
<
Wow
::
Request
...
...
lib/blizzard_api/wow/game_data/creature.rb
View file @
86e0dc38
...
...
@@ -3,7 +3,7 @@
module
BlizzardApi
module
Wow
##
# This class allows access to World of Warcraft
achievement
s
# This class allows access to World of Warcraft
creature
s
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-game-data-api
#
...
...
lib/blizzard_api/wow/game_data/reputation_faction.rb
0 → 100644
View file @
86e0dc38
# frozen_string_literal: true
module
BlizzardApi
module
Wow
##
# This class allows access to World of Warcraft reputation
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-game-data-api
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.creature
class
ReputationFaction
<
Wow
::
GenericDataEndpoint
protected
def
endpoint_setup
@endpoint
=
'reputation-faction'
@namespace
=
:static
@collection
=
'achievements'
@ttl
=
CACHE_TRIMESTER
end
end
end
end
lib/blizzard_api/wow/game_data/reputation_tier.rb
0 → 100644
View file @
86e0dc38
# frozen_string_literal: true
module
BlizzardApi
module
Wow
##
# This class allows access to World of Warcraft reputation
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-game-data-api
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.creature
class
ReputationTier
<
Wow
::
GenericDataEndpoint
protected
def
endpoint_setup
@endpoint
=
'reputation-tiers'
@namespace
=
:static
@collection
=
'achievements'
@ttl
=
CACHE_TRIMESTER
end
end
end
end
lib/blizzard_api/wow/profile/character_profile.rb
View file @
86e0dc38
...
...
@@ -12,25 +12,8 @@ module BlizzardApi
class
CharacterProfile
<
Wow
::
Request
# Valid fields for character profile requests
VALID_FIELDS
=
%w[
achievements
appearance
feed
guild
hunterPets
items
mounts
pets
petSlots
professions
progression
pvp
quests
reputation
statistics
stats
talents
titles
audit
achievements appearance feed guild hunterPets items mounts pets petSlots professions progression
pvp quests reputation statistics stats talents titles audit
]
.
freeze
##
...
...
@@ -272,6 +255,62 @@ module BlizzardApi
character_request
realm
,
character
,
options
,
'collections'
end
##
# Return a character's pet collection
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-profile-api
#
# @param realm [String] The character realm's slug
# @param character [String] The character name
# @!macro request_options
#
# @!macro response
def
pets
(
realm
,
character
,
options
=
{})
character_request
realm
,
character
,
options
,
'collections/pets'
end
##
# Return a character's mount collection
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-profile-api
#
# @param realm [String] The character realm's slug
# @param character [String] The character name
# @!macro request_options
#
# @!macro response
def
mounts
(
realm
,
character
,
options
=
{})
character_request
realm
,
character
,
options
,
'collections/mounts'
end
##
# Return a character's reputations
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-profile-api
#
# @param realm [String] The character realm's slug
# @param character [String] The character name
# @!macro request_options
#
# @!macro response
def
reputation
(
realm
,
character
,
options
=
{})
character_request
realm
,
character
,
options
,
'reputations'
end
##
# Return a character's hunter pets
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-profile-api
#
# @param realm [String] The character realm's slug
# @param character [String] The character name
# @!macro request_options
#
# @!macro response
def
hunter_pets
(
realm
,
character
,
options
=
{})
character_request
realm
,
character
,
options
,
'hunter-pets'
end
##
# Return a character's raid progression
#
...
...
test/blizzard/wow/game_data/reputation_faction_test.rb
0 → 100644
View file @
86e0dc38
# frozen_string_literal: true
require
'test_helper'
module
BlizzardApi
module
Wow
class
ReputationFactionTest
<
Minitest
::
Test
def
setup
@reputation
=
BlizzardApi
::
Wow
::
ReputationFaction
.
new
end
def
test_reputation_tier_index
reputation_data
=
@reputation
.
index
assert_equal
196
,
reputation_data
[
:factions
].
count
end
def
test_reputation_tier_get
reputation_data
=
@reputation
.
get
1105
assert_equal
'The Oracles'
,
reputation_data
[
:name
][
:en_US
]
end
end
end
end
test/blizzard/wow/game_data/reputation_tier_test.rb
0 → 100644
View file @
86e0dc38
# frozen_string_literal: true
require
'test_helper'
module
BlizzardApi
module
Wow
class
ReputationTierTest
<
Minitest
::
Test
def
setup
@reputation
=
BlizzardApi
::
Wow
::
ReputationTier
.
new
end
def
test_reputation_tier_index
reputation_data
=
@reputation
.
index
assert_equal
37
,
reputation_data
[
:reputation_tiers
].
count
end
def
test_reputation_tier_get
reputation_data
=
@reputation
.
get
26
assert_equal
'Nat Pagle'
,
reputation_data
[
:faction
][
:name
][
:en_US
]
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment