Skip to content

Commit

Permalink
classname change
Browse files Browse the repository at this point in the history
  • Loading branch information
khrome committed Jul 9, 2016
1 parent c2b9d4d commit ac7218c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions services/xbox-live-card.js
Expand Up @@ -10,16 +10,16 @@ var disabledProxy = function(){

var gameCache = {};

function MyAuthenticatedService(options){
function GamerCardService(options){
XBoxService.apply(this, arguments);
this.url = 'http://gamercard.xbox.com/en-US/{gamertag}.card';
}

MyAuthenticatedService.prototype = clone(XBoxService.prototype);
MyAuthenticatedService.prototype.constructor = MyAuthenticatedService;
GamerCardService.prototype = clone(XBoxService.prototype);
GamerCardService.prototype.constructor = GamerCardService;


MyAuthenticatedService.prototype.profile = function(options, callback){
GamerCardService.prototype.profile = function(options, callback){
this.fetch({
gamertag : options.gamertag
}, function(err, data){
Expand All @@ -31,15 +31,15 @@ MyAuthenticatedService.prototype.profile = function(options, callback){
});
}

MyAuthenticatedService.prototype.games = function(options, callback){
GamerCardService.prototype.games = function(options, callback){
if(!(options.id || options.gameid)){
return callback(undefined, Object.keys(gameCache).map(function(id){ return gameCache[id] }));
}
var game = gameCache[options.id || options.gameid];
callback(game?undefined:new Error('Game not found'), game);
}

MyAuthenticatedService.prototype.parseResponse = function(response, body, callback){
GamerCardService.prototype.parseResponse = function(response, body, callback){
parseXML(body, function (err, resp) {
var result = {};
var cls = resp.html.body[0].div[0]['$']['class'];
Expand Down Expand Up @@ -80,11 +80,11 @@ MyAuthenticatedService.prototype.parseResponse = function(response, body, callba
});
}

MyAuthenticatedService.prototype.friends = function(options, callback){
GamerCardService.prototype.friends = function(options, callback){
throw new Error('Gamertag endpoint does not support requesting the friends');
}

MyAuthenticatedService.prototype.acheivements = function(options, callback){
GamerCardService.prototype.acheivements = function(options, callback){
throw new Error('Gamertag endpoint does not support requesting the acheivements');
}
module.exports = MyAuthenticatedService;
module.exports = GamerCardService;

0 comments on commit ac7218c

Please sign in to comment.