Skip to content

Instantly share code, notes, and snippets.

@hiddentao
Last active February 14, 2017 10:44
Show Gist options
  • Save hiddentao/41179b98292a900b78eeb73f40d03316 to your computer and use it in GitHub Desktop.
Save hiddentao/41179b98292a900b78eeb73f40d03316 to your computer and use it in GitHub Desktop.
Linked-In Auto-send all People You May Know invites
/*
For use on: "My Network" page
This will first load full list of invite suggestions by auto-scrolling to bottom of page.
Once no more suggestions are left to load it will auto-connect to all by clicking all
Connect buttons (with 100ms interval between each click).
How to run: Run the below code in your browser's Javascript console (see
Developer Tools in chrome). DO NOT close or change the browser tab whilst this is running.
It does 1 connection per second - so give it a good 10 minutes to be done with all.
*/
(() => {
let prev=0, unchangedCount=0;
var sent = 0;
var timer = setInterval(() => {
let cur = $('.pymk-card').size();
if (cur > prev) {
unchangedCount = 0;
prev = cur; window.scrollTo(0, document.body.scrollHeight);
} else {
unchangedCount++;
if (5 < unchangedCount) {
clearInterval(timer);
$('.pymk-card button.mn-person-card__person-btn-ext').each(function(index) {
var btn = this; setTimeout(() => {
btn.click();
console.log("Connections sent: " + (++sent));
}, index*1000);
});
}
}
}, 1000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment