Skip to content

Instantly share code, notes, and snippets.

@jacklynrose
Created October 31, 2013 04:35
Show Gist options
  • Save jacklynrose/7244414 to your computer and use it in GitHub Desktop.
Save jacklynrose/7244414 to your computer and use it in GitHub Desktop.
Grabbing the commit stats by week for the past year for the rails/rails repo
$.getJSON("https://api.github.com/repos/rails/rails/stats/commit_activity", function(data) {
var week_count = 1;
var commits_by_week = data.map(function(week) {
var total = 0;
$.each(week['days'], function(k, v) { total += v });
return total;
});
$.each(commits_by_week, function (k, v) {
console.log("Week " + week_count + ": " + v + " commits");
week_count++;
}
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment