Adds Steam auth and API

This commit is contained in:
Karl Jakober
2014-02-05 16:37:48 +00:00
parent 1ff27464fe
commit aa36ad9fbb
8 changed files with 117 additions and 3 deletions

View File

@@ -12,6 +12,9 @@ var foursquare = require('node-foursquare')({ secrets: secrets.foursquare });
var Github = require('github-api');
var Twit = require('twit');
var paypal = require('paypal-rest-sdk');
var steam = require('steam-web');
/**
* GET /api
@@ -331,4 +334,25 @@ exports.getPayPalCancel = function(req, res, next) {
result: true,
canceled: true
});
};
/**
* GET /api/steam
* Steam API example.
*/
exports.getSteam = function(req, res) {
var S = new steam({
apiKey: secrets.steam.apiKey
});
S.getPlayerSummaries({
steamids: [ req.user.steam ],
callback: function(err, data) {
res.render('api/steam', {
title: 'Steam Web API',
players: data.response.players,
});
}
});
};