Skip to content

Instantly share code, notes, and snippets.

@melix
Created December 17, 2012 16:30
Show Gist options
  • Save melix/4319631 to your computer and use it in GitHub Desktop.
Save melix/4319631 to your computer and use it in GitHub Desktop.
Groovy contributors
def parser = new groovy.json.JsonSlurper()
def contribs = parser.parseText(new URL('https://api.github.com/repos/groovy/groovy-core/contributors').text)
def stats = contribs.inject([sum:0,contribs:[:]]) { map, val ->
map.contribs[val.login] = val.contributions
map.sum += val.contributions
map
}
stats.contribs.each {
println "${it.key.padRight(16)} = $it.value (${(int)(100*it.value/stats.sum)}%)"
}
stats.sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment