This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async.each(urls, function(url, callback){ | |
console.log("Grabbing Dataset from " + url); | |
makeRequest(url, function(){ | |
callback(); | |
}); | |
}, function(err){ | |
console.log("Hello"); | |
if(err){ | |
console.log("Error grabbing data"); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
PROBLEM: We do not know how many iterations we'll need to perform to access all of the data. | |
We want an algorithm to iterate over a page of data, and under some conditions | |
continue to run the requests function repeatedly until we reach a break condition. | |
Essentially, the runtime of the loop is dynamically changing and we need a way to | |
handle an indeterminate number of requests. | |
*/ | |
// Starting page counter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Precondition: | |
* ownerName (string): The owner username of the target repository | |
* repoName (string): The target repository name | |
* Postcondition: | |
* An array of objects, where each object contains the following properties: | |
* name (string): The contributor username | |
* issues_opened (string): The number of issues closed by the respective contributor | |
**/ | |
router.get('/issues_closed', function(req, res) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
gitApp.controller('reportController', function($scope, commitsFactory, locFactory, commitCommentsFactory, | |
issuesAssignedFactory, issuesClosedFactory, issuesOpenedFactory, issuesCommentsFactory, | |
pullsFactory, pullRequestCommentsFactory){ | |
$scope.commitData = []; | |
$scope.locData = []; | |
$scope.commitCommentsData = []; | |
$scope.issuesAssignedData = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.get('/issues_closed', function(req, res) { | |
request({ | |
url: 'https://api.github.com/repos/' + req.query.owner + '/' + req.query.repo + '/contributors' + '?' + 'client_id=' + CLIENT_ID + '&' + 'client_secret=' + CLIENT_SECRET, | |
headers: { 'user-agent': 'git-technetium' }, | |
json: true | |
}, function(error, response, body) { | |
if(!error && response.statusCode === 200) { | |
var contributors = []; | |
for(var contributorIndex = 0; contributorIndex < body.length; contributorIndex++){ | |
contributors.push(body[contributorIndex].login); |