Created
March 9, 2017 20:09
-
-
Save trieloff/d8055d7dd8cd959098ba58090a0553a5 to your computer and use it in GitHub Desktop.
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
var github = { | |
checkLicense: function(uri) { | |
return request({ | |
"method": "GET", | |
"uri": uri, | |
"json": true, | |
"headers": { | |
"Authorization": "Bearer " + github.token, | |
"User-Agent": "My little demo app" | |
} | |
}).then(function(fulfilled_body) { | |
return false; | |
}, function(rejected_body){ | |
return uri; | |
}); | |
} | |
}; | |
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) | |
.map(github.checkLicense); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment