To create a client object:
var client = new Wow.Armory.Client();To retrieve the character sheet:
client.getCharacterSheet({
character: 'Wetall',
realm: 'Dunemaul',
success: function(character, s, xhr) {
/* do something with the JSON version of the character sheet here */
},
failure: function(xhr, s, e) {
/* we failed somewhere along the line with the request */
}
});
To retrieve item information:client.getItemInfo({
itemId: 22630,
success: function(item, s, xhr) {
/* do something with the JSON version of the item here */
},
failure: function(xhr, s, e) {
/* we failed somewhere along the line with the request */
}
});
To do a general search query:client.search({
searchType: Wow.Armory.SearchType.Characters, /* as well as All, Items, and Guilds */
searchQuery: 'Calox', /* this parameter is optional! */
success: function(results, s, xhr) {
/* do something with the JSON results here */
},
failure: function(xhr, s, e) {
/* we failed somewhere along the line with the request */
}
});
This is merely scratching the surface! With serious usage the mileage may vary, but should any serious problems arise please report them at github so that I can do my best to rectify the situation.
No comments:
Post a Comment