Created
February 6, 2020 01:54
-
-
Save piroor/426fd86aca3d3d05d3996941f0b8c80f to your computer and use it in GitHub Desktop.
Find AWS/Amazon developers from contributors
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
// Run this script with the web console for contributors list pages on your Web browser, for example: | |
// https://github.com/antirez/redis/graphs/contributors | |
// https://github.com/mongodb/mongo/graphs/contributors | |
// https://github.com/apache/kafka/graphs/contributors | |
(async () => { | |
let promises = []; | |
for (const url of Array.from(new Set(Array.from(document.querySelectorAll('a[href][data-hovercard-type="user"]'), link => link.href)))) { | |
const win = window.open(url); | |
promises.push(new Promise(resolve => { | |
win.addEventListener('DOMContentLoaded', () => { | |
resolve(); | |
if (!win.document.querySelector('div[itemtype="http://schema.org/Person"]').textContent.match(/AWS|Amazon/)) | |
win.close(); | |
}, { once: true }); | |
})); | |
if (promises.length > 10) { | |
await Promise.all(promises); | |
promises = []; | |
} | |
} | |
await Promise.all(promises); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment