Skip to content

Instantly share code, notes, and snippets.

@trieloff
Last active March 9, 2017 20:00
Show Gist options
  • Save trieloff/59560e2475c33da1ab0abc971c89e8a7 to your computer and use it in GitHub Desktop.
Save trieloff/59560e2475c33da1ab0abc971c89e8a7 to your computer and use it in GitHub Desktop.
var github = {
isPublic: function(repo) {
return !repo.private;
},
isOriginal: function(repo) {
return !repo.fork;
},
licenseUrl: function(repo) {
return repo.contents_url.replace(/\{\+path\}/,"LICENSE");
}
}
function main(params) {
github.token = params.token;
return github.getUser()
.then(github.getUserReposUrl)
.then(github.getUserRepos)
.filter(github.isPublic)
.filter(github.isOriginal)
.map(github.licenseUrl);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment