Created
March 13, 2019 15:07
-
-
Save szepnapot/ac7f90bc1516387d303ff7ec0c461427 to your computer and use it in GitHub Desktop.
get email from github user [https://stackoverflow.com/a/44229207/5682956]
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
<input id=username type="text" placeholder="github username or repo link"> | |
<button onclick="fetch(`https://api.github.com/users/${username.value.replace(/^.*com[/]([^/]*).*$/,'$1')}/events/public`).then(e=> e.json()).then(e => [...new Set([].concat.apply([],e.filter(x => x.type==='PushEvent').map(x => x.payload.commits.map(c => c.author.email)))).values()]).then(x => results.innerText = x)">GO</button> | |
<div id=results></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment