<commit_before>var GitHubApi = require("github");

var github = new GitHubApi({
    // optional
    debug: true,
    protocol: "http",
    host: "api.github", // should be api.github.com for GitHub
    pathPrefix: "/api/v3", // for some GHEs; none for GitHub
    headers: {
        "user-agent": "Jarvis" // GitHub is happy with a unique user agent
    },
    Promise: require('bluebird'),
    followRedirects: false, // default: true; there's currently an issue with non-get redirects, so allow ability to disable follow-redirects
    timeout: 5000
});

// TODO: optional authentication here depending on desired endpoints. See below in README.

github.users.getFollowingForUser({
    // optional
    // headers: {
    //     "cookie": "blahblah"
    // },
    username: "vbhagat"
}, function(err, res) {
    console.log(JSON.stringify(res));
});<commit_msg>all functionality<commit_after>var GitHubApi = require("github");

var github = new GitHubApi({
    // optional
   // debug: true,
    //protocol: "http",
    //host: "api.github.com", // should be api.github.com for GitHub
    //pathPrefix: "/api/v3", // for some GHEs; none for GitHub
    //headers: {
    //   "Accept": "application/vnd.github.v3+json"   
	//   "user-agent": "vbhagat" // GitHub is happy with a unique user agent
    //},
    //Promise: require('bluebird'),
    //followRedirects: false, // default: true; there's currently an issue with non-get redirects, so allow ability to //disable follow-redirects
    //timeout: 5000
});

// TODO: optional authentication here depending on desired endpoints. See below in README.

//github.users.getFollowingForUser({
    // optional
    // headers: {
    //     "cookie": "blahblah"
    // },
//    username: "defunkt"
//}, function(err, res) {
//    console.log(JSON.stringify(res));
//});

//github.search.repos({ ... });
//github.search.repos({
    // optional
    // headers: {
    //     "cookie": "blahblah"
    // },
//    q: "jarvis"
//}, function(err, res) {
//    console.log(JSON.stringify(res));
//});

function getfeatures(owner , repo){
github.repos.getBranches({ 
 owner: owner ,
 repo: repo
 },function(err, res) {
      var count = 0
	  for (var item in res) {
	//	console.log(JSON.stringify(res[item]));
	  count++;
	  }
	  console.log(count - 1);
	//console.log(JSON.stringify(res));
 });
}

getfeatures("jessicalynn", "jarvis");

function getLastPushed(owner, repo, branch){
 github.repos.getBranch({ 
 owner: owner,
 repo: repo,
 branch: branch
 },function(err, res) {

	
	console.log(JSON.stringify(res.commit.commit.author.name));
 });
}

getLastPushed("jessicalynn","jarvis", "45-GitHub");


function getLatestPullRequest(owner, repo){
github.pullRequests.getAll({ 
 owner: owner ,
 repo: repo,
 state: "open"
 },function(err, res) {

	num = 1;
	console.log(JSON.stringify(res[0].title));
 });
 
}

getLatestPullRequest("jessicalynn", "jarvis");

function getLastClosedPullRequest ( owner, repo){
 github.pullRequests.getAll({ 
 owner: owner ,
 repo: repo,
 state: "closed"
 },function(err, res) {

	num = 1;
	console.log(JSON.stringify(res[0].title));
 });
}

getLastClosedPullRequest("jessicalynn", "jarvis");
 
 function getLastBranchChangeTime(owner , repo , branch){
 github.repos.getBranch({ 
 owner: owner ,
 repo: repo,
 branch: branch
 },function(err, res) {

	
	console.log(JSON.stringify(res.commit.commit.author.date));
 });
 }
 
 getLastBranchChangeTime("jessicalynn","jarvis","45-GitHub")
 
 function getContributors(owner, repo){
 github.repos.getContributors({ 
 owner : owner,
 repo : repo
 },function(err, res) {

	for (var item in res) {
	if ((JSON.stringify(res[item].login)) == null)
	{   }
	
	else console.log(JSON.stringify(res[item].login));
	  
	  }
	//console.log(JSON.stringify(res));
 });
 }
 
 getContributors("jessicalynn","jarvis");
//github.orgs.checkTeamRepo({ 
// id: "",
// owner:"",
// repo:""
 
// },function(err, res) {
//    console.log(JSON.stringify(res));
//});


//github.authenticate({
//    type: "basic",
//    username: vbhagat,
//    password: <PASSWORD>
//});
{'fraction_non_alphanumeric': 0.17694965449160907, 'fraction_numerical': 0.005182625863770977, 'mean_word_length': 3.2934322033898304, 'pattern_counts': {'":': 6, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3251712', 'n_tokens_mistral': 1409, 'n_tokens_neox': 1322, 'n_words': 303}