meta_nexus 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +2 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.travis.yml +10 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +48 -0
- data/Rakefile +6 -0
- data/TODO.md +49 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/meta_nexus.rb +31 -0
- data/lib/meta_nexus/api.rb +12 -0
- data/lib/meta_nexus/config.rb +9 -0
- data/lib/meta_nexus/d3.rb +9 -0
- data/lib/meta_nexus/d3/data.rb +47 -0
- data/lib/meta_nexus/d3/profile.rb +33 -0
- data/lib/meta_nexus/sc2.rb +9 -0
- data/lib/meta_nexus/sc2/data.rb +25 -0
- data/lib/meta_nexus/sc2/ladder.rb +17 -0
- data/lib/meta_nexus/sc2/profile.rb +49 -0
- data/lib/meta_nexus/version.rb +3 -0
- data/lib/meta_nexus/wow.rb +9 -0
- data/lib/meta_nexus/wow/achievement.rb +18 -0
- data/lib/meta_nexus/wow/auction.rb +19 -0
- data/lib/meta_nexus/wow/battlepet.rb +63 -0
- data/lib/meta_nexus/wow/challenge_mode.rb +31 -0
- data/lib/meta_nexus/wow/character.rb +55 -0
- data/lib/meta_nexus/wow/data.rb +71 -0
- data/lib/meta_nexus/wow/guild.rb +44 -0
- data/lib/meta_nexus/wow/item.rb +32 -0
- data/lib/meta_nexus/wow/pvp.rb +18 -0
- data/lib/meta_nexus/wow/quest.rb +18 -0
- data/lib/meta_nexus/wow/realm.rb +32 -0
- data/lib/meta_nexus/wow/recipe.rb +18 -0
- data/lib/meta_nexus/wow/spell.rb +18 -0
- data/meta_nexus.gemspec +31 -0
- metadata +199 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: acaec49e0d117a87359cb4704eeef9f25dd38566
|
4
|
+
data.tar.gz: 97a92682a0e7ef6f330a93ad36ef268e36ade4e0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7d2bc71c447c45c062efaaf06e0bf876283d99631de219d54be9ebd416b19fcebd86b192402dcbc24bab16124ea955246d02dff5695a7e2275dc946663024169
|
7
|
+
data.tar.gz: 97554f8ff90da445b101afc50b7c68f3680c8d2e4a7d12d48f96584494c45b2e71835d9d9a12a2240d6a42de95d8aa5f2a7d70bf605c25c5789f67fece4f9ce5
|
data/.codeclimate.yml
ADDED
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.2.2
|
4
|
+
before_install: gem install bundler -v 1.10.3
|
5
|
+
addons:
|
6
|
+
code_climate:
|
7
|
+
repo_token: e293a091d593f35ae5e95e7bf750d2ee1c7695200aa98095d74ead494ee6bd45
|
8
|
+
|
9
|
+
env:
|
10
|
+
secure: "X0812KB22DcFQzGy8d1X1+EqkpwhiOaKNB2BX7xob2pvSI3b+YNGSqN1/N+tWH3I5QqDeJcyFTwjp67Omm1c3yhvWyrPTCM5ZQFndLusGcRdnPL5GGlcRpwDHrVei9K3yvcudnBuisbGID6x3WovGepNr72lQFTUs/2EWwEonitvuilp38X/sQn6iw2FahhC81Axj1DmPgJHJjV6vcigs6Y3DC7Hp0zYDMhbcLAu2FE457+DFih1VOdD8XP8+QkIrgoqyZqSP/h2nbs1WJuecmYf99SOQuj77SpDR4RCJ2OBcACy+HYZjQpwiIFU27ortO85cvvnvPiNy/NEHzmZtZP5Ro9YHJYLakAFZcur90mngbFTGVVoKdSAkzeOW6rpjs4z6C56mWfHmLqt/97oHx3dC2kyd4vTUP4EXDcSUrkpJFu941AtKIiJHYuKF2zUyEEp9DUdtPxhowi5ZzJkIAqVw/nnBbrEvjKmDWJv9STBl86Bbe7REIryhoPUDi51W4/rBh2yVCDHe5umoKr4yV6eVx0FOts002p35QxhRb2UGrnLSe1TgR2Kd8ANAXYPylt0b8Q3CYu/GGFSaRiLRYRWK/geL4gA5izxpjAeXHl4bofXBhsDmrcX0PeHPYhy6RoGM3wHOXHjF4Pn1WPofoi3O5F/NikmIB2oXstnlIA="
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Freika
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# MetaNexus
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/Freika/meta_nexus.svg?branch=master)](https://travis-ci.org/Freika/meta_nexus)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/Freika/meta_nexus/badges/gpa.svg)](https://codeclimate.com/github/Freika/meta_nexus)
|
5
|
+
[![Test Coverage](https://codeclimate.com/github/Freika/meta_nexus/badges/coverage.svg)](https://codeclimate.com/github/Freika/meta_nexus/coverage)
|
6
|
+
[![Dependency Status](https://gemnasium.com/Freika/meta_nexus.svg)](https://gemnasium.com/Freika/meta_nexus)
|
7
|
+
|
8
|
+
|
9
|
+
[TODO list](https://github.com/Freika/meta_nexus/blob/master/TODO.md)
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'meta_nexus'
|
17
|
+
```
|
18
|
+
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
$ gem install meta_nexus
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
Configure gem:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
MetaNexus.config do |c|
|
33
|
+
c.region = 'us'
|
34
|
+
c.locale = 'en_US'
|
35
|
+
c.api_key = 'your_key'
|
36
|
+
end
|
37
|
+
```
|
38
|
+
|
39
|
+
Default value for region is `eu`, for locale - `en_GB`. Api key can be stored in environment variable `ENV['BNET_API_KEY']`.
|
40
|
+
|
41
|
+
## Contributing
|
42
|
+
|
43
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Freika/meta_nexus.
|
44
|
+
|
45
|
+
## License
|
46
|
+
|
47
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
48
|
+
|
data/Rakefile
ADDED
data/TODO.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# TODO List
|
2
|
+
|
3
|
+
## WoW
|
4
|
+
|
5
|
+
### Challenge Mode
|
6
|
+
- [x] Getting Realm Leaderboard
|
7
|
+
- [x] Getting Region Leaderboard
|
8
|
+
> There is no tests for challenge modes yet.
|
9
|
+
|
10
|
+
### PVP
|
11
|
+
|
12
|
+
- [x] Getting leaderboards
|
13
|
+
> There is no tests for leaderboards yet.
|
14
|
+
|
15
|
+
### Realms
|
16
|
+
|
17
|
+
- [x] Getting realm status
|
18
|
+
> There is no tests for realm status yet.
|
19
|
+
|
20
|
+
### Data resources
|
21
|
+
|
22
|
+
- [x] Getting battlegroups
|
23
|
+
- [x] Getting character achievements
|
24
|
+
- [x] Getting guild rewards
|
25
|
+
- [x] Getting guild achievements
|
26
|
+
- [x] Getting talents
|
27
|
+
> There is no tests for battlegroups, character and guild achievements, guild rewards and talents modes yet.
|
28
|
+
|
29
|
+
|
30
|
+
## Diablo 3
|
31
|
+
|
32
|
+
### Data resources
|
33
|
+
|
34
|
+
- [x] Artisan
|
35
|
+
|
36
|
+
## Starcraft 2
|
37
|
+
|
38
|
+
### Ladder
|
39
|
+
|
40
|
+
- [x] Ladders
|
41
|
+
|
42
|
+
### Data resources
|
43
|
+
|
44
|
+
- [x] Achievements
|
45
|
+
- [x] Rewards
|
46
|
+
|
47
|
+
## Refactorings
|
48
|
+
|
49
|
+
- [ ] Use fixtures to handle rspec expectations instead of inline hashes.
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "meta_nexus"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/lib/meta_nexus.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
require 'meta_nexus/version'
|
3
|
+
require 'meta_nexus/api'
|
4
|
+
require 'meta_nexus/wow'
|
5
|
+
require 'meta_nexus/wow/achievement'
|
6
|
+
require 'meta_nexus/wow/auction'
|
7
|
+
require 'meta_nexus/wow/battlepet'
|
8
|
+
require 'meta_nexus/wow/challenge_mode'
|
9
|
+
require 'meta_nexus/wow/character'
|
10
|
+
require 'meta_nexus/wow/item'
|
11
|
+
require 'meta_nexus/wow/guild'
|
12
|
+
require 'meta_nexus/wow/pvp'
|
13
|
+
require 'meta_nexus/wow/quest'
|
14
|
+
require 'meta_nexus/wow/realm'
|
15
|
+
require 'meta_nexus/wow/spell'
|
16
|
+
require 'meta_nexus/wow/recipe'
|
17
|
+
require 'meta_nexus/wow/data'
|
18
|
+
require 'meta_nexus/d3'
|
19
|
+
require 'meta_nexus/d3/profile'
|
20
|
+
require 'meta_nexus/d3/data'
|
21
|
+
require 'meta_nexus/sc2'
|
22
|
+
require 'meta_nexus/sc2/profile'
|
23
|
+
require 'meta_nexus/sc2/ladder'
|
24
|
+
require 'meta_nexus/sc2/data'
|
25
|
+
require 'meta_nexus/config'
|
26
|
+
|
27
|
+
module MetaNexus
|
28
|
+
def self.config
|
29
|
+
@config ||= MetaNexus::Config.new
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
class MetaNexus::D3::Data < MetaNexus::D3
|
2
|
+
|
3
|
+
# Find D3 Item Data in Battle.net Diablo 3 Api
|
4
|
+
# Required arguments:
|
5
|
+
# name - item name
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
# d3 = MetaNexus::D3::Data
|
9
|
+
# d3.data('hand-axe')
|
10
|
+
# Response in Hash:
|
11
|
+
# {"id"=>"Axe_1H_001", "name"=>"Hand Axe", "icon"=>"axe_1h_001_demonhunter_male", "displayColor"=>"white", "tooltipParams"=>"item/hand-axe", "requiredLevel"=>1, "itemLevel"=>1, "stackSizeMax"=>0, ...
|
12
|
+
#
|
13
|
+
# Find D3 Follower data in Battle.net Diablo 3 Api
|
14
|
+
# Required arguments:
|
15
|
+
# klass - follower class
|
16
|
+
#
|
17
|
+
# Example:
|
18
|
+
# d3 = MetaNexus::D3::Data
|
19
|
+
# d3.follower('templar')
|
20
|
+
# Resonse in Hash:
|
21
|
+
# {"slug"=>"templar", "name"=>"Templar", "realName"=>"d3.follower.templar.realName", "portrait"=>"templar", "skills"=> ...
|
22
|
+
#
|
23
|
+
# Find D3 artisan data in Battle.net Diablo 3 Api
|
24
|
+
# Required arguments:
|
25
|
+
# name - artisan name
|
26
|
+
#
|
27
|
+
# Example:
|
28
|
+
# d3 = MetaNexus::D3::Data
|
29
|
+
# d3.artisan('blacksmith')
|
30
|
+
# Resonse in Hash will contain all artisan item
|
31
|
+
#
|
32
|
+
|
33
|
+
def self.item(name)
|
34
|
+
call_url = "#{client.url}/data/item/#{name}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
35
|
+
MetaNexus::Api.call_api(call_url)
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.follower(klass)
|
39
|
+
call_url = "#{client.url}/data/follower/#{klass}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
40
|
+
MetaNexus::Api.call_api(call_url)
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.artisan(name)
|
44
|
+
call_url = "#{client.url}/data/artisan/#{name}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
45
|
+
MetaNexus::Api.call_api(call_url)
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class MetaNexus::D3::Profile < MetaNexus::D3
|
2
|
+
|
3
|
+
# Find D3 Profile in Battle.net Diablo 3 Api
|
4
|
+
# Required arguments:
|
5
|
+
# battle_tag - User battle tag, must be used in such format: 'Name-1212' (replace '#' symbol with '-')
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
# d3 = MetaNexus::D3::Profile
|
9
|
+
# d3.profile('Scorch-2320')
|
10
|
+
# Response in Hash:
|
11
|
+
# {"battleTag" : "Scorch#2826", "paragonLevel" : 224, "paragonLevelHardcore" : 0,"paragonLevelSeason" : 4,"paragonLevelSeasonHardcore" : 0,"heroes" : [ {"paragonLevel" : 224, ...
|
12
|
+
#
|
13
|
+
# Find D3 character in Battle.net Diablo 3 Api
|
14
|
+
# Required arguments:
|
15
|
+
# battle_tag - User battle tag, must be used in such format: 'Name-1212' (replace '#' symbol with '-')
|
16
|
+
# hero_id - id of hero to look for
|
17
|
+
#
|
18
|
+
# Example:
|
19
|
+
# d3 = MetaNexus::D3::Profile
|
20
|
+
# d3.hero('Scorch-2320', 9034002)
|
21
|
+
# Resonse in Hash will contain info about character
|
22
|
+
#
|
23
|
+
|
24
|
+
def self.profile(battle_tag)
|
25
|
+
call_url = "#{client.url}/profile/#{battle_tag}/?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
26
|
+
MetaNexus::Api.call_api(call_url)
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.hero(battle_tag, hero_id)
|
30
|
+
call_url = "#{client.url}/profile/#{battle_tag}/hero/#{hero_id}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
31
|
+
MetaNexus::Api.call_api(call_url)
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class MetaNexus::Sc2::Data < MetaNexus::Sc2
|
2
|
+
|
3
|
+
# Find Sc2 achievements data in Battle.net StarCraft 2 Api
|
4
|
+
# Example:
|
5
|
+
# sc2 = MetaNexus::Sc2::Data
|
6
|
+
# sc2.achievements
|
7
|
+
# Response in Hash will contain huge data array with achievements
|
8
|
+
#
|
9
|
+
# Find Sc2 Follower data in Battle.net Diablo 3 Api
|
10
|
+
# Example:
|
11
|
+
# sc2 = MetaNexus::Sc2::Data
|
12
|
+
# sc2.rewards
|
13
|
+
# Response in Hash will contain huge data array with rewards
|
14
|
+
#
|
15
|
+
|
16
|
+
def self.achievements
|
17
|
+
call_url = "#{client.url}/data/achievements?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
18
|
+
MetaNexus::Api.call_api(call_url)
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.rewards
|
22
|
+
call_url = "#{client.url}/data/rewards?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
23
|
+
MetaNexus::Api.call_api(call_url)
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class MetaNexus::Sc2::Ladder < MetaNexus::Sc2
|
2
|
+
|
3
|
+
# Find Sc2 Ladder info in Battle.net StarCraft 2 Api
|
4
|
+
# Required arguments:
|
5
|
+
# id - Ladder id
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
# sc2 = MetaNexus::Sc2::Ladder.new('eu', 'ru_RU', 'api_key')
|
9
|
+
# sc2.ladder(2200)
|
10
|
+
# Response in Hash will contain huge data about top players on ladder.
|
11
|
+
#
|
12
|
+
|
13
|
+
def self.ladder(id)
|
14
|
+
call_url = "#{client.url}/ladder/#{id}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
15
|
+
MetaNexus::Api.call_api(call_url)
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class MetaNexus::Sc2::Profile < MetaNexus::Sc2
|
2
|
+
|
3
|
+
# Find Sc2 Profile in Battle.net StarCraft 2 Api
|
4
|
+
# Required arguments:
|
5
|
+
# id - User profile id
|
6
|
+
# region - User profile region id
|
7
|
+
# name - User profile name
|
8
|
+
#
|
9
|
+
# Example:
|
10
|
+
# sc2 = MetaNexus::Sc2::Profile.new('eu', 'ru_RU', 'api_key')
|
11
|
+
# sc2.profile(10886, 2, 'out')
|
12
|
+
# Response in Hash:
|
13
|
+
# {"id"=>10886, "realm"=>2, "displayName"=>"out", "clanName"=>"TopolM", "clanTag"=>"SS27", "profilePath"=>"/profile/10886/2/out/", "portrait"=>{"x"=>-270, "y"=>-270, "w"=>90, "h"=>90, "offset"=>21, ...
|
14
|
+
#
|
15
|
+
# Find Sc2 profile ladders in Battle.net StarCraft 2 Api
|
16
|
+
# Required arguments: same as for profile
|
17
|
+
#
|
18
|
+
# Example:
|
19
|
+
# Sc2 = MetaNexus::Sc2::Profile
|
20
|
+
# sc2.ladders(10886, 2, 'out')
|
21
|
+
# Resonse in Hash:
|
22
|
+
# {"currentSeason"=>[], "previousSeason"=>[], "showcasePlacement"=>[]}
|
23
|
+
#
|
24
|
+
# Find Sc2 profile match history in Battle.net Diablo 3 Api
|
25
|
+
# Required arguments: same as for profile
|
26
|
+
#
|
27
|
+
# Example:
|
28
|
+
# Sc2 = MetaNexus::Sc2::Profile
|
29
|
+
# sc2.match_history(10886, 2, 'out')
|
30
|
+
# Resonse in Hash:
|
31
|
+
# {"matches"=>[{"map"=>"Исследовательский комплекс", "type"=>"THREES", "decision"=>"WIN", "speed"=>"FASTER", ...
|
32
|
+
#
|
33
|
+
|
34
|
+
def self.profile(id, region, name)
|
35
|
+
call_url = "#{client.url}/profile/#{id}/#{region}/#{name}/?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
36
|
+
MetaNexus::Api.call_api(call_url)
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.ladders(id, region, name)
|
40
|
+
call_url = "#{client.url}/profile/#{id}/#{region}/#{name}/ladders?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
41
|
+
MetaNexus::Api.call_api(call_url)
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.match_history(id, region, name)
|
45
|
+
call_url = "#{client.url}/profile/#{id}/#{region}/#{name}/matches?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
46
|
+
MetaNexus::Api.call_api(call_url)
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class MetaNexus::Wow::Achievement < MetaNexus::Wow
|
2
|
+
|
3
|
+
# Find Achievement in Battle.net WoW Api
|
4
|
+
# Required arguments:
|
5
|
+
# id - achievement id
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
# achievement = MetaNexus::Wow::Achievement
|
9
|
+
# achievement.find(200)
|
10
|
+
# Response in Hash:
|
11
|
+
# {"id"=>200, "title"=>"Persistent Defender", "points"=>10, "description"=>"Return 50 flags as a defender in Warsong Gulch.", "rewardItems"=>[], "icon"=>"achievement_bg_interruptx_flagcapture_attempts", "criteria"=>[{"id"=>440, "description"=>"Return the flag 50 times", "orderIndex"=>1, "max"=>50}], "accountWide"=>false, "factionId"=>2}
|
12
|
+
#
|
13
|
+
|
14
|
+
def self.find(id)
|
15
|
+
call_url = "#{client.url}/achievement/#{id}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
16
|
+
MetaNexus::Api.call_api(call_url)
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class MetaNexus::Wow::Auction < MetaNexus::Wow
|
2
|
+
|
3
|
+
# Find Auction in Battle.net WoW Api
|
4
|
+
# Required arguments:
|
5
|
+
# realm - realm name
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
# auction = MetaNexus::Wow::Auction
|
9
|
+
# auction.find('eversong')
|
10
|
+
# Response in Hash:
|
11
|
+
# {"id"=>200, "title"=>"Persistent Defender", "points"=>10, "description"=>"Return 50 flags as a defender in Warsong Gulch.", "rewardItems"=>[], "icon"=>"Auction_bg_interruptx_flagcapture_attempts", "criteria"=>[{"id"=>440, "description"=>"Return the flag 50 times", "orderIndex"=>1, "max"=>50}], "accountWide"=>false, "factionId"=>2}
|
12
|
+
#
|
13
|
+
|
14
|
+
def self.find(realm)
|
15
|
+
client = MetaNexus::Wow.new
|
16
|
+
call_url = "#{client.url}/auction/data/#{realm}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
17
|
+
MetaNexus::Api.call_api(call_url)
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
class MetaNexus::Wow::BattlePet < MetaNexus::Wow
|
2
|
+
|
3
|
+
attr_accessor :breed_id, :level, :quality_id
|
4
|
+
|
5
|
+
# Find BattlePet ability in Battle.net WoW Api
|
6
|
+
#
|
7
|
+
# Required arguments:
|
8
|
+
# id - ability id
|
9
|
+
#
|
10
|
+
# Example:
|
11
|
+
# battlepet = MetaNexus::Wow::BattlePet
|
12
|
+
# battlepet.ability(640)
|
13
|
+
# Response in Hash:
|
14
|
+
# {"id"=>640, "name"=>"Toxic Smoke", "icon"=>"spell_shadow_plaguecloud", "cooldown"=>0, "rounds"=>1, "petTypeId"=>9, "isPassive"=>false, "hideHints"=>false}
|
15
|
+
#
|
16
|
+
|
17
|
+
# Find BattlePet species in Battle.net WoW Api
|
18
|
+
#
|
19
|
+
# Required arguments:
|
20
|
+
# id - species id
|
21
|
+
#
|
22
|
+
# Example:
|
23
|
+
# battlepet = MetaNexus::Wow::BattlePet
|
24
|
+
# battlepet.species(258)
|
25
|
+
# Response in Hash:
|
26
|
+
# {"speciesId"=>258, "petTypeId"=>9, "creatureId"=>42078, "name"=>"Mini Thor", ... }
|
27
|
+
#
|
28
|
+
|
29
|
+
# Find BattlePet stats in Battle.net WoW Api
|
30
|
+
#
|
31
|
+
# Required arguments:
|
32
|
+
# id - battle pet id
|
33
|
+
#
|
34
|
+
# Optional arguments:
|
35
|
+
#
|
36
|
+
# breed_id - Breed id
|
37
|
+
# quality_id - Quality id
|
38
|
+
# level - Level
|
39
|
+
#
|
40
|
+
# Example:
|
41
|
+
# battlepet = MetaNexus::Wow::BattlePet
|
42
|
+
# battlepet.stats(258)
|
43
|
+
# Response in Hash:
|
44
|
+
# {"speciesId"=>258, "breedId"=>3, "petQualityId"=>1, "level"=>25, "health"=>1338, "power"=>261, "speed"=>193}
|
45
|
+
#
|
46
|
+
|
47
|
+
|
48
|
+
[:ability, :species].each do |type|
|
49
|
+
define_singleton_method(type.to_sym) do |id|
|
50
|
+
call_url = "#{client.url}/battlePet/#{type.to_s}/#{id}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
51
|
+
MetaNexus::Api.call_api(call_url)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.stats(id, **args)
|
56
|
+
call_url = "#{client.url}/battlePet/stats/#{id}?"
|
57
|
+
call_url += "level=#{args[:level]}&" if args[:level]
|
58
|
+
call_url += "breedId=#{args[:breed_id]}&" if args[:breed_id]
|
59
|
+
call_url += "qualityId=#{args[:quality_id]}&" if args[:quality_id]
|
60
|
+
call_url += "locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
61
|
+
MetaNexus::Api.call_api(call_url)
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class MetaNexus::Wow::ChallengeMode < MetaNexus::Wow
|
2
|
+
|
3
|
+
# Get information about challenge mode stats in certain realm
|
4
|
+
# Required arguments:
|
5
|
+
# realm - realm name
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
# challenge_mode = MetaNexus::Wow::ChallengeMode.get('eu', 'en_US', 'api_key')
|
9
|
+
# challenge_mode.get('eversong')
|
10
|
+
# Response in Hash:
|
11
|
+
# { "challenge": [{ "realm": { "name": "Eversong", "slug": "eversong", "battlegroup": "Vindication", "locale": "ru_RU", "timezone": "Europe/Paris", "connected_realms": ["eversong"] } ...
|
12
|
+
#
|
13
|
+
# Get information about top-100 players in current region
|
14
|
+
#
|
15
|
+
# Example:
|
16
|
+
# challenge_mode = MetaNexus::Wow::ChallengeMode.get('eu', 'en_US', 'api_key')
|
17
|
+
# challenge_mode.region
|
18
|
+
# Response in Hash:
|
19
|
+
# {"challenge":[{"map":{"id":1182,"name":"Auchindoun","slug":"auchindoun","hasChallengeMode":true,"bronzeCriteria":{"time":3300000,"hours":0,"minutes":55,"seconds":0,"milliseconds":0,"isPositive":true},"silverCriteria": ...
|
20
|
+
#
|
21
|
+
|
22
|
+
def self.realm(realm)
|
23
|
+
call_url = "#{client.url}/challenge/#{realm}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
24
|
+
MetaNexus::Api.call_api(call_url)
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.region
|
28
|
+
call_url = "#{client.url}/challenge/region?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
29
|
+
MetaNexus::Api.call_api(call_url)
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
class MetaNexus::Wow::Character < MetaNexus::Wow
|
2
|
+
attr_accessor :achievements, :appearance, :feed, :guild, :hunter_pets, :items,
|
3
|
+
:mounts, :pets, :pet_slots, :progression, :pvp, :quests, :reputation,
|
4
|
+
:stats, :talents, :titles, :audit
|
5
|
+
|
6
|
+
FIELDS = %i(achievements appearance feed guild hunter_pets items mounts pets pet_slots progression pvp quests reputation stats talents titles audit).freeze
|
7
|
+
|
8
|
+
# Find Character in Battle.net WoW Api
|
9
|
+
# Required arguments:
|
10
|
+
# realm - character realm
|
11
|
+
# name - character name
|
12
|
+
#
|
13
|
+
# Optional arguments:
|
14
|
+
#
|
15
|
+
# achievements: true - character achievements info
|
16
|
+
# appearance: true - character appearance info
|
17
|
+
# feed: true - character feed info
|
18
|
+
# guild: true - character guild info
|
19
|
+
# hunter_pets: true - character hunter_pets info
|
20
|
+
# items: true - character items info
|
21
|
+
# mounts: true - character mounts info
|
22
|
+
# pets: true - character pets info
|
23
|
+
# pet_slots: true - character pet_slots info
|
24
|
+
# progression: true - character progression info
|
25
|
+
# pvp: true - character pvp info
|
26
|
+
# quests: true - character quests info
|
27
|
+
# reputation: true - character reputation info
|
28
|
+
# stats: true - character stats info
|
29
|
+
# talents: true - character talents info
|
30
|
+
# titles: true - character titles info
|
31
|
+
# audit: true - character audit info
|
32
|
+
#
|
33
|
+
# Example:
|
34
|
+
# character = MetaNexus::Wow::Character
|
35
|
+
# character.find('shadowsong', 'Redstone')
|
36
|
+
# Response in Hash:
|
37
|
+
# {"lastModified"=>1435160620000, "name"=>"Redstone", "realm"=>"Shadowsong", "battlegroup"=>"Reckoning / Abrechnung", "class"=>8, "race"=>2, "gender"=>1, "level"=>90, "achievementPoints"=>8390, "thumbnail"=>"internal-record-3666/105/93238889-avatar.jpg", "calcClass"=>"e", "totalHonorableKills"=>4519}
|
38
|
+
#
|
39
|
+
# If you want to get character info with any additional fields, such as achievements or character appearance, you should explicitly call it.
|
40
|
+
# Example:
|
41
|
+
# character.find('shadowsong', 'Redstone', appearance: true)
|
42
|
+
# This will return character info along with his appearance info.
|
43
|
+
#
|
44
|
+
|
45
|
+
def self.find(args)
|
46
|
+
call_url = "#{client.url}/character/#{args[:realm]}/#{args[:name]}?"
|
47
|
+
|
48
|
+
fields = FIELDS.map { |field| args[field] ? field : next }.join(',')
|
49
|
+
|
50
|
+
call_url << '&fields=' + fields if fields
|
51
|
+
call_url += "locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
52
|
+
|
53
|
+
MetaNexus::Api.call_api(call_url)
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
class MetaNexus::Wow::Data < MetaNexus::Wow
|
2
|
+
|
3
|
+
# Find data info in Battle.net WoW Api
|
4
|
+
#
|
5
|
+
# Example:
|
6
|
+
# data = MetaNexus::Wow::Data
|
7
|
+
# data.battlegroups
|
8
|
+
# data.character_races
|
9
|
+
# data.character_classes
|
10
|
+
# data.character_achievements
|
11
|
+
# data.guild_achievements
|
12
|
+
# data.guild_rewards
|
13
|
+
# data.guild_perks
|
14
|
+
# data.item_classes
|
15
|
+
# data.talents
|
16
|
+
# data.pet_types
|
17
|
+
#
|
18
|
+
# Each method will return appropriate information in Hash format.
|
19
|
+
#
|
20
|
+
|
21
|
+
def self.battlegroups
|
22
|
+
call_url = "#{client.url}/data/battlegroups/?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
23
|
+
MetaNexus::Api.call_api(call_url)
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.character_races
|
27
|
+
call_url = "#{client.url}/data/character/races?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
28
|
+
MetaNexus::Api.call_api(call_url)
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.character_classes
|
32
|
+
call_url = "#{client.url}/data/character/classes?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
33
|
+
MetaNexus::Api.call_api(call_url)
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.character_achievements
|
37
|
+
call_url = "#{client.url}/data/character/achievements?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
38
|
+
MetaNexus::Api.call_api(call_url)
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.guild_achievements
|
42
|
+
call_url = "#{client.url}/data/guild/achievements?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
43
|
+
MetaNexus::Api.call_api(call_url)
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.guild_rewards
|
47
|
+
call_url = "#{client.url}/data/guild/rewards?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
48
|
+
MetaNexus::Api.call_api(call_url)
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.guild_perks
|
52
|
+
call_url = "#{client.url}/data/guild/perks?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
53
|
+
MetaNexus::Api.call_api(call_url)
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.item_classes
|
57
|
+
call_url = "#{client.url}/data/item/classes?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
58
|
+
MetaNexus::Api.call_api(call_url)
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.talents
|
62
|
+
call_url = "#{client.url}/data/talents?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
63
|
+
MetaNexus::Api.call_api(call_url)
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.pet_types
|
67
|
+
call_url = "#{client.url}/data/pet/types?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
68
|
+
MetaNexus::Api.call_api(call_url)
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
class MetaNexus::Wow::Guild < MetaNexus::Wow
|
2
|
+
|
3
|
+
# Find Guild profile in Battle.net WoW Api
|
4
|
+
# Required arguments:
|
5
|
+
# realm - guild realm
|
6
|
+
# guildname - guild name
|
7
|
+
#
|
8
|
+
# Optional arguments:
|
9
|
+
#
|
10
|
+
# achievements: true - guild achievements info
|
11
|
+
# news: true - guild news info
|
12
|
+
# challenge: true - guild challenge info
|
13
|
+
# challenge: true - guild challenge info
|
14
|
+
# members: true - guild members info
|
15
|
+
#
|
16
|
+
# Example:
|
17
|
+
# guild = MetaNexus::Wow::Guild
|
18
|
+
# guild.find('shadowsong', 'Goblins')
|
19
|
+
# Response in Hash:
|
20
|
+
# {"lastModified"=>1435259544000, "name"=>"Goblins", "realm"=>"Shadowsong", "battlegroup"=>"Reckoning / Abrechnung", "level"=>25, "side"=>1, "achievementPoints"=>2500, "emblem"=>{"icon"=>12, "iconColor"=>"ffb1b8b1", "border"=>3, "borderColor"=>"ffffffff", "backgroundColor"=>"ff232323"}}
|
21
|
+
#
|
22
|
+
# If you want to get guild info with any additional fields, such as achievements or guild news, you should explicitly call it.
|
23
|
+
# Example:
|
24
|
+
# guild.find('shadowsong', 'Redstone', news: true)
|
25
|
+
# This will return guild info along with his news info.
|
26
|
+
#
|
27
|
+
|
28
|
+
def self.find(realm, guildname, **args)
|
29
|
+
call_url = "#{client.url}/guild/#{realm}/#{guildname}?"
|
30
|
+
|
31
|
+
fields = 'fields=' if args
|
32
|
+
fields += 'achievements,' if args[:achievements]
|
33
|
+
fields += 'challenge,' if args[:challenge]
|
34
|
+
fields += 'members,' if args[:members]
|
35
|
+
fields += 'news,' if args[:news]
|
36
|
+
|
37
|
+
call_url += fields if fields
|
38
|
+
call_url += '&' if args
|
39
|
+
|
40
|
+
call_url += "locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
41
|
+
MetaNexus::Api.call_api(call_url)
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class MetaNexus::Wow::Item < MetaNexus::Wow
|
2
|
+
|
3
|
+
# Find Item in Battle.net WoW Api
|
4
|
+
# Required arguments:
|
5
|
+
# id - item id
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
# item = MetaNexus::Wow::Item
|
9
|
+
# item.find(18803)
|
10
|
+
# Response in Hash:
|
11
|
+
# {"id"=>18803, "disenchantingSkillRank"=>225, "description"=>"Property of Finkle Einhorn, ...
|
12
|
+
#
|
13
|
+
# Find Item set in Battle.net WoW Api
|
14
|
+
# Required arguments:
|
15
|
+
# set_id - set id
|
16
|
+
# Example:
|
17
|
+
# item = MetaNexus::Wow::Item
|
18
|
+
# item.set(1060)
|
19
|
+
# Response in Hash:
|
20
|
+
# {"id"=>1060, "name"=>"Deep Earth Vestments", "setBonuses"=>[{"description"=>"Reduces the mana cost of ...
|
21
|
+
#
|
22
|
+
|
23
|
+
def self.find(id)
|
24
|
+
call_url = "#{client.url}/item/#{id}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
25
|
+
MetaNexus::Api.call_api(call_url)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.set(id)
|
29
|
+
call_url = "#{client.url}/item/set/#{id}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
30
|
+
MetaNexus::Api.call_api(call_url)
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class MetaNexus::Wow::Pvp < MetaNexus::Wow
|
2
|
+
|
3
|
+
# Find PVP leaderboards info in Battle.net WoW Api
|
4
|
+
# Required arguments:
|
5
|
+
# bracket - bracket. Valid entries are: '2v2', '3v3', '5v5' and 'rbg'
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
# bracket = MetaNexus::Wow::Pvp
|
9
|
+
# bracket.leaderboard('2v2')
|
10
|
+
# Response in Hash:
|
11
|
+
# Huge hash with leaderboard.
|
12
|
+
#
|
13
|
+
|
14
|
+
def self.leaderboard(bracket)
|
15
|
+
call_url = "#{client.url}/leaderboard/#{bracket}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
16
|
+
MetaNexus::Api.call_api(call_url)
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class MetaNexus::Wow::Quest < MetaNexus::Wow
|
2
|
+
|
3
|
+
# Find Quest info in Battle.net WoW Api
|
4
|
+
# Required arguments:
|
5
|
+
# id - quest id
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
# quest = MetaNexus::Wow::Quest
|
9
|
+
# quest.find('2v2')
|
10
|
+
# Response in Hash:
|
11
|
+
# {"id"=>13146, "title"=>"Generosity Abounds", "reqLevel"=>77, "suggestedPartyMembers"=>0, "category"=>"Icecrown", "level"=>80}
|
12
|
+
#
|
13
|
+
|
14
|
+
def self.find(id)
|
15
|
+
call_url = "#{client.url}/quest/#{id}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
16
|
+
MetaNexus::Api.call_api(call_url)
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class MetaNexus::Wow::Realm < MetaNexus::Wow
|
2
|
+
|
3
|
+
# Find Realm info in Battle.net WoW Api
|
4
|
+
# Required arguments:
|
5
|
+
# realm - Realm name
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
# realm = MetaNexus::Wow::Realm
|
9
|
+
# realm.find('shadowsong')
|
10
|
+
# Response in Hash:
|
11
|
+
# {"realms": [{ "type": "pvp", "population": "high", "queue": false, "wintergrasp": { "area": 1, "controlling-faction": 0, "status": 0, "next":}, "tol-barad": { "area": 21, "controlling-faction": 0, "status": 1, "next":}, "status": true, "name": "Aegwynn", "slug": "aegwynn", "battlegroup": "Misery", "locale": "de_DE", "timezone": "Europe/Paris", "connected_realms": ["aegwynn", "internal-record" } ...
|
12
|
+
#
|
13
|
+
# PvP Area Status Fields
|
14
|
+
#
|
15
|
+
# area - An internal id of this zone.
|
16
|
+
# controlling-faction - Which faction is controlling the zone at the moment. Possible values are
|
17
|
+
# 0: Alliance
|
18
|
+
# 1: Horde
|
19
|
+
# 2: Neutral
|
20
|
+
# status - The current status of the zone. The possible values are
|
21
|
+
# -1: Unknown
|
22
|
+
# 0: Idle
|
23
|
+
# 1: Populating
|
24
|
+
# 2: Active
|
25
|
+
# 3: Concluded
|
26
|
+
# next - A timestamp of when the next battle starts.
|
27
|
+
|
28
|
+
def self.status
|
29
|
+
call_url = "#{client.url}/realm/status?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
30
|
+
MetaNexus::Api.call_api(call_url)
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class MetaNexus::Wow::Recipe < MetaNexus::Wow
|
2
|
+
|
3
|
+
# Find recipe info in Battle.net WoW Api
|
4
|
+
# Required arguments:
|
5
|
+
# id - recipe id
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
# recipe = MetaNexus::Wow::Recipe
|
9
|
+
# recipe.find('2v2')
|
10
|
+
# Response in Hash:
|
11
|
+
# {"id"=>33994, "name"=>"Precise Strikes", "profession"=>"Enchanting", "icon"=>"spell_holy_greaterheal"}
|
12
|
+
#
|
13
|
+
|
14
|
+
def self.find(id)
|
15
|
+
call_url = "#{client.url}/recipe/#{id}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
16
|
+
MetaNexus::Api.call_api(call_url)
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class MetaNexus::Wow::Spell < MetaNexus::Wow
|
2
|
+
|
3
|
+
# Find Spell info in Battle.net WoW Api
|
4
|
+
# Required arguments:
|
5
|
+
# id - spell id
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
# spell = MetaNexus::Wow::Spell
|
9
|
+
# spell.find(8056)
|
10
|
+
# Response in Hash:
|
11
|
+
# {"id"=>8056, "name"=>"Frost Shock", "icon"=>"spell_frost_frostshock", "description"=>"Instantly shocks an enemy with frost, dealing 2,631 Frost damage and reducing the target's movement speed by 50%. Lasts 8 sec.", "range"=>"25 yd range", "powerCost"=>"1.25% of base mana", "castTime"=>"Instant", "cooldown"=>"6 sec cooldown"}
|
12
|
+
#
|
13
|
+
|
14
|
+
def self.find(id)
|
15
|
+
call_url = "#{client.url}/spell/#{id}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
|
16
|
+
MetaNexus::Api.call_api(call_url)
|
17
|
+
end
|
18
|
+
end
|
data/meta_nexus.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'meta_nexus/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'meta_nexus'
|
8
|
+
spec.version = MetaNexus::VERSION
|
9
|
+
spec.authors = ['Freika']
|
10
|
+
spec.email = ['frey@list.ru']
|
11
|
+
|
12
|
+
spec.summary = 'Ruby Gem for accessing Battle.net web api.'
|
13
|
+
spec.description = 'With this gem you can get access to Blizzard\'s games web api.'
|
14
|
+
spec.homepage = 'https://github.com/Freika/meta_nexus'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = 'exe'
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ['lib']
|
21
|
+
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.10'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
spec.add_development_dependency 'rspec', '~>3.2'
|
25
|
+
spec.add_development_dependency 'vcr', '~> 2.9', '>= 2.9.3'
|
26
|
+
spec.add_development_dependency 'webmock', '~>1.21'
|
27
|
+
spec.add_development_dependency 'dotenv', '~>2.0'
|
28
|
+
spec.add_development_dependency 'codeclimate-test-reporter', '~>0'
|
29
|
+
|
30
|
+
spec.add_runtime_dependency 'httparty', '~>0.13.5'
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,199 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: meta_nexus
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Freika
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-07-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.2'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: vcr
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.9'
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 2.9.3
|
65
|
+
type: :development
|
66
|
+
prerelease: false
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - "~>"
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '2.9'
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 2.9.3
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: webmock
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '1.21'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '1.21'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: dotenv
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '2.0'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '2.0'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: codeclimate-test-reporter
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: httparty
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 0.13.5
|
124
|
+
type: :runtime
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: 0.13.5
|
131
|
+
description: With this gem you can get access to Blizzard's games web api.
|
132
|
+
email:
|
133
|
+
- frey@list.ru
|
134
|
+
executables: []
|
135
|
+
extensions: []
|
136
|
+
extra_rdoc_files: []
|
137
|
+
files:
|
138
|
+
- ".codeclimate.yml"
|
139
|
+
- ".gitignore"
|
140
|
+
- ".rspec"
|
141
|
+
- ".travis.yml"
|
142
|
+
- Gemfile
|
143
|
+
- LICENSE.txt
|
144
|
+
- README.md
|
145
|
+
- Rakefile
|
146
|
+
- TODO.md
|
147
|
+
- bin/console
|
148
|
+
- bin/setup
|
149
|
+
- lib/meta_nexus.rb
|
150
|
+
- lib/meta_nexus/api.rb
|
151
|
+
- lib/meta_nexus/config.rb
|
152
|
+
- lib/meta_nexus/d3.rb
|
153
|
+
- lib/meta_nexus/d3/data.rb
|
154
|
+
- lib/meta_nexus/d3/profile.rb
|
155
|
+
- lib/meta_nexus/sc2.rb
|
156
|
+
- lib/meta_nexus/sc2/data.rb
|
157
|
+
- lib/meta_nexus/sc2/ladder.rb
|
158
|
+
- lib/meta_nexus/sc2/profile.rb
|
159
|
+
- lib/meta_nexus/version.rb
|
160
|
+
- lib/meta_nexus/wow.rb
|
161
|
+
- lib/meta_nexus/wow/achievement.rb
|
162
|
+
- lib/meta_nexus/wow/auction.rb
|
163
|
+
- lib/meta_nexus/wow/battlepet.rb
|
164
|
+
- lib/meta_nexus/wow/challenge_mode.rb
|
165
|
+
- lib/meta_nexus/wow/character.rb
|
166
|
+
- lib/meta_nexus/wow/data.rb
|
167
|
+
- lib/meta_nexus/wow/guild.rb
|
168
|
+
- lib/meta_nexus/wow/item.rb
|
169
|
+
- lib/meta_nexus/wow/pvp.rb
|
170
|
+
- lib/meta_nexus/wow/quest.rb
|
171
|
+
- lib/meta_nexus/wow/realm.rb
|
172
|
+
- lib/meta_nexus/wow/recipe.rb
|
173
|
+
- lib/meta_nexus/wow/spell.rb
|
174
|
+
- meta_nexus.gemspec
|
175
|
+
homepage: https://github.com/Freika/meta_nexus
|
176
|
+
licenses:
|
177
|
+
- MIT
|
178
|
+
metadata: {}
|
179
|
+
post_install_message:
|
180
|
+
rdoc_options: []
|
181
|
+
require_paths:
|
182
|
+
- lib
|
183
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
|
+
requirements:
|
190
|
+
- - ">="
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
193
|
+
requirements: []
|
194
|
+
rubyforge_project:
|
195
|
+
rubygems_version: 2.4.6
|
196
|
+
signing_key:
|
197
|
+
specification_version: 4
|
198
|
+
summary: Ruby Gem for accessing Battle.net web api.
|
199
|
+
test_files: []
|