Created
September 15, 2014 12:08
-
-
Save doubleshow/dffc8ee93ba17c1b1051 to your computer and use it in GitHub Desktop.
Template for a program to grab all the events about a repository
This file contains 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
var GitHubApi = require("github"); | |
var async = require("async"); | |
var github = new GitHubApi({ | |
// required | |
version: "3.0.0", | |
// optional | |
timeout: 5000 | |
}); | |
function getClassEventsForPage(i, callback){ | |
// TODO: | |
}; | |
// [ [a,a,a], [b,b,b], ... ] -> [a,a,a,b,b,b, ... ] | |
function flatten_fast(input){ | |
// TODO: Use a faster implementation | |
// (ref: http://jsperf.com/flatten-an-array-loop-vs-reduce) | |
} | |
async.map([/* TODO */], getClassEventsForPage, function(err, results){ | |
// TODO: This must be implemented | |
flattened = flatten_fast(results); | |
console.log(JSON.stringify(flattened, undefined, 4)); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment