New github api page with a repo information example

Bootstrap-Well ios7 style
This commit is contained in:
Sahat Yalkabov
2013-12-07 21:44:26 -05:00
parent 717628834e
commit d7f19c483f
7 changed files with 124 additions and 17 deletions

View File

@ -8,7 +8,7 @@ var geoip = require('geoip-lite');
var FB = require('fb');
var tumblr = require('tumblr.js');
var foursquare = require('node-foursquare')({ secrets: config.foursquare });
var Github = require('github-api');
/**
* GET /api
@ -118,4 +118,47 @@ exports.getScraping = function(req, res) {
user: req.user
});
});
};
};
exports.getGithub = function(req, res) {
var token = _.findWhere(req.user.tokens, { kind: 'github' });
if (!token) {
return res.render('api/unauthorized', {
title: 'GitHub API',
provider: 'GitHub',
user: req.user
});
}
// TODO: Fix rate limit on passport-github token
var github = new Github({ token: token.token });
var repo = github.getRepo('sahat', 'cloudbucket');
repo.show(function(err, repo) {
res.render('api/github', {
title: 'GitHub API',
repo: repo,
user: req.user
});
});
};
exports.getTwilio = function(req, res) {
};
exports.getEtsy = function(req, res) {
};
exports.getNewYorkTimes = function(req, res) {
};
exports.getLastfm = function(req, res) {
};
exports.getTwitter = function(req, res) {
};