How to use the github.GitHubApi function in github

To help you get started, we’ve selected a few github examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LockerProject / Locker / Connectors / GitHub / profile.js View on Github external
var GitHubApi = require("github").GitHubApi;
var github = new GitHubApi();

exports.sync = function(processInfo, cb) {
    var auth = processInfo.auth;
    // auth.headers = {"Authorization":"token "+auth.accessToken, "Connection":"keep-alive"};
    github.getUserApi().show(auth.username, function(err, profile) {
        auth.profile = profile;
        cb(err, {auth: auth, data : {profile : [{obj: profile}]}});
    });
};
github cliftonc / calipso / modules / core / repo / repo.js View on Github external
function repoHome(req, res, template, block, next) {
     
    calipso.error("This is an error message ...",{hello:"world"});
  
    var github = new GitHubApi(true);
    github.getRepoApi().show('cliftonc', 'calipso',function(err, repo) {
        calipso.theme.renderItem(req, res, sys.inspect(repo,true,10,false), block, {},next);        
    });
  
    // Render the item via the template provided above
    
  
};
github mostlygeek / GitHub-Hiring-Candidate-Finder / node / test-with-promises.js View on Github external
var Promise = require('./promise');
var https = require('https');
var GitHubApi = require("github").GitHubApi;
var github = new GitHubApi(true);
var cache = require('./CachePromise').Cache('./cache', function(msg) {
    console.log("DEBUG: " + msg);
});

/**
 * Repositories to fetch watchers for
 */
var repos = [  'PushButtonLabs/PushButtonEngine'
             , 'mikechambers/as3corelib' 
             , 'robertpenner/as3-signals'
             , 'AdamAtomic/flixel'
             , 'robotlegs/robotlegs-framework'
             , 'flexunit/flexunit'             
            ];

var users = {};
github astro / gitpop / flipcollaborator.js View on Github external
var github = require('github');
var step = require('step');

var login = process.argv[2];
var apiToken = process.argv[3];;
var user = process.argv[4];
var repo = process.argv[5];
var collaborators = process.argv.slice(6);
if (!user || !repo || !user || !repo) {
    console.error("Usage: " + process.argv[0] + " " + process.argv[1] + "     [collaborators...]");
    process.exit(1);
}

var api = new github.GitHubApi(false, null, true);
api.getRequest().setOption('http_port', 80);
api.authenticateToken(login, apiToken);


var repoApi = api.getRepoApi();
repoApi.addCollaborator = function(user, repo, collaborator, callback) {
    this.$api.post('repos/collaborators/' + user + '/' + repo + '/add/' + collaborator,
		   {}, null, this.$createListener(callback, 'collaborators'));
};
repoApi.rmCollaborator = function(user, repo, collaborator, callback) {
    this.$api.post('repos/collaborators/' + user + '/' + repo + '/remove/' + collaborator,
		   {}, null, this.$createListener(callback, 'collaborators'));
};

function takeNext() {
    if (collaborators.length < 1) {
github LockerProject / Locker / Connectors / GitHub / repos.js View on Github external
var GitHubApi = require("github").GitHubApi
  , request = require('request')
  , github = new GitHubApi()
  , async = require('async')
  , nfs = require('node-fs')
  , fs = require('fs')
  , lockerUrl
  , auth
  , viewers = []
  ;

exports.sync = function(processInfo, cb) {
    auth = processInfo.auth;
    auth.headers = {"Authorization":"token "+auth.accessToken, "Connection":"keep-alive"};
    var cached = {};
    if (processInfo.config && processInfo.config.cached)
        cached = processInfo.config.cached;
    lockerUrl = processInfo.lockerUrl;
    exports.syncRepos(cached, function(err, repos) {
github pylonide / pylon / server / cloud9 / ext / issues / issues.js View on Github external
var IssuesPlugin = module.exports = function(ide) {
    this.ide       = ide;
    this.hooks     = ["command"];
    this.name      = "issues";
    this.api       = new nodegh();
    this.issuesApi = this.api.getIssueApi();

    this.ghUrlTest = {
         "ssh": {
             re: /[\w]+@github\.com:([\w\.\d-_]+)\/([\w\.\d-_]+)$/,
             pattern: "git@github.com:{context}/{name}"
         },
         "http": {
             re: /^https\:\/\/([\w\.\d-_]+)@github\.com\/(\1|[\w\.\d-_]+)\/([\w\.\d-_]+)$/,
             pattern: "https://{context}@github.com/{context_or_organization}/{name}"
         },
         "readonly": {
             re: /^git\:\/\/github\.com\/([\w\.\d-_]+)\/([\w\.\d\-\_]+)$/,
             pattern: "git://github.com/{context}/{name}"
         }
     }