xtian / node-armory Goto Github PK
View Code? Open in Web Editor NEWA simple node.js wrapper around Blizzard's REST API for World of Warcraft.
License: MIT License
A simple node.js wrapper around Blizzard's REST API for World of Warcraft.
License: MIT License
Like this:
var header_date = new Date().toUTCString();
headers['Date'] = header_date;
And
signature.update(
'GET\n' +
header_date + '\n' +
encodeURI(path) + '\n'
);
~chris
Hi,
I am trying to set the public/private keys like so:
a=require('armory')
a.publicKey=process.env.WOW_API_PUBLIC_KEY
a.privateKey=process.env.WOW_API_PRIVATE_KEY
a.classes({region:"eu"},function(){})
a has the properties set, but its not seeing them internally to use in the actual api call. I guess I am doing it wrong.
It looks to me as if the wrap/initParam's functions are ensuring the calls use the original armory object and not the one I have set the properties on, and I cant see a way to set the properties on the underlying original armory object.
So, I thought this might work:
a = require('armory')
a.publicKey=process.env.WOW_API_PUBLIC_KEY
a.privateKey=process.env.WOW_API_PRIVATE_KEY
b = a.defaults({})
b.classes({region:"eu"},function(){})
But still no joy - how do I do it?
Thanks,
Chris
This is more a discussion placeholder - it seems Blizzard are revamping the api - https://dev.battle.net/
It seems to work differently, e.g. linking to your Battle.net account.
Not sure if it replaces/adds to the existing API - from the skim read I did, it seems like its goal is to replace it.
Attempting to poll achievement, characterAchievements, or guildAchievements all fail:
[Error: When in doubt, blow it up. (page not found)]
{"status":"nok","reason":"When in doubt, blow it up. (page not found)"}
I have patched my version to only add the /? when there are query options.
Need to re-run the tests, but I guess they worked as there was always parameters present.
Although, just noticed the Battlegroups call requires it, at least the spec says so...
Battlegroups
The battlegroups data API provides the list of battlegroups for this region. Please note the trailing / on this request url.
URL = Host + "/api/wow/data/battlegroups/"
Hi,
Blizzard have added context for items - see discussion around it here: http://us.battle.net/en/forum/topic/14882018658
For example:
This call:
http://us.battle.net/api/wow/item/112826
returns:
{"id":112826,"availableContexts":["raid-finder","raid-normal","raid-heroic","raid-mythic"]}
Which you can then 'refine' into this call:
http://us.battle.net/api/wow/item/112826/raid-mythic
Which gives you the context specific item.
Thanks in advance,
Chris
Like this:
signature.update(
'GET\n' +
header_date + '\n' +
encodeURI(path) + '\n'
);
Otherwise you get invalid signature errors for any realms/names with exotic chars - even a space.
Regards,
Chris
Hi,
I am getting some occasional internal server errors when I call the armory.
Is there a way to use a proxy like Charles to see the full response details?
Or is there a better way to view this, eg verbose on :)
I see that the request library used, https://github.com/mikeal/request, supports proxies.
I am thinking to give node-armory a way of passing through http options, perhaps as an extra option.
Thanks,
Chris
PS A sample way of doing this is in this fork:
https://github.com/kimptoc/node-armory
No tests added :( - could do something like use sinon to mock a proxy server and test via that...
Hey there.
I am new to Node, so I am sure that I am missing a step here and maybe you can help.
What I am trying to do is:
app.post('/api/character', function(req, res) {
var armory = require('armory').defaults({
name: req.body.characterName,
realm: req.body.serverName,
region: req.body.serverCountry,
_query: 'stats,professions,titles,items,reputation,mounts,pets,achievements'
})
armory.character(function(err, character){
console.log(character);
})
res.status(200).send('angular send off');
});
So, the '_query' should have all of the fields that I am trying to request from the Blizzard API for that specific character, but it is just empty when I console.log it in 'armory/index.js' file that you created.
What I am missing here to get your wrapper class to send off the fields to API to get back all of that data?
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.