goodcodeguy / battlenet-api Goto Github PK
View Code? Open in Web Editor NEWSimple API Wrapper for the New BattleNet APIs ( https://dev.battle.net/ )
License: MIT License
Simple API Wrapper for the New BattleNet APIs ( https://dev.battle.net/ )
License: MIT License
client.character_progression("Eversong", "Коротышик")
=> #<HTTParty::Response:0x7fd77094adf0 parsed_response={"lastModified"=>1414227271000, "name"=>"Коротышик", "realm"=>"Eversong", "battlegroup"=>"Vindication", "class"=>6, "race"=>2, "gender"=>0, "level"=>90, "achievementPoints"=>8345, "thumbnail"=>"eversong/178/83824050-avatar.jpg", "calcClass"=>"d", "totalHonorableKills"=>1107}, @response=#<Net::HTTPOK 200 OK readbody=true>, @headers={"content-language"=>["en-GB"], "content-type"=>["application/json;charset=UTF-8"], "date"=>["Sun, 07 Dec 2014 09:53:15 GMT"], "last-modified"=>["Sat, 25 Oct 2014 08:54:31 GMT"], "server"=>["Apache"], "vary"=>["Accept-Encoding"], "x-frame-options"=>["SAMEORIGIN"], "x-mashery-responder"=>["prod-j-worker-us-east-1d-57.mashery.com"], "content-length"=>["233"], "connection"=>["Close"]}>
All character_ methods returns the same, there is no any progression, achievements or other character information. Isn't it implemented yet, or I just don't know how to get it properly?
Thanks
Refactor all of the CGI.escape
and character replacement calls to a util class.
:001 > client = Battlenet.WOWClient
=> #<Battlenet::WOWClient:0x007feb9b505d00 @api_key="********", @region=:us, @endpoint="/wow">
In my config/initializers/battlenet.rb:
Battlenet.configure do |config|
config.api_key = ENV['BNET_API_KEY']
config.region = :eu
end
Settings is for EU, but client I create in console asks for US API
I try to call methods and some of them returns
2.1.4 :006 > c.battlepet_ability(113)
NoMethodError: undefined method `gsub' for 113:Fixnum
from /Users/frey/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/uri/common.rb:304:in `escape'
from /Users/frey/.rvm/rubies/ruby-2.1.4/lib/ruby/2.1.0/uri/common.rb:623:in `escape'
from /Users/frey/frails/compareteams/vendor/battlenet-api/lib/battlenet/modules/wow/battlepet.rb:6:in `battlepet_ability'
This line contains code URI.escape
, and when I remove it, all works fine. So is it really necessary?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.