Skip to content

Instantly share code, notes, and snippets.

@mehmetkurt
Last active May 30, 2018 14:19
Show Gist options
  • Save mehmetkurt/a299af25a6914f4dd5ba9597ff90907e to your computer and use it in GitHub Desktop.
Save mehmetkurt/a299af25a6914f4dd5ba9597ff90907e to your computer and use it in GitHub Desktop.
LinkedIn Bulk Invite : LinkedInHack
/*
Open Chrome Developer Tools
Select Console Tab
Paste the following code
and press the Enter!
Subscribe Youtube Channel : https://www.youtube.com/codeislifes
*/
function wait(ms) {
var start = new Date().getTime();
var end = start;
while (end < start + ms) {
end = new Date().getTime();
}
}
var currentIntervals = [];
function followButtons() {
let i = 0;
let buttons = document.querySelectorAll('.button-secondary-small');
let titles = document.querySelectorAll('.pymk-card__name');
let totalButtonsCount = (buttons.length - 1);
let currentInterval = setInterval(function () {
if (totalButtonsCount === i || i === 0) {
console.log('--------------> Get New Buttons <--------------');
buttons = document.querySelectorAll('.button-secondary-small');
totalButtonsCount = (buttons.length - 1);
titles = document.querySelectorAll('.pymk-card__name');
i = 0;
wait(2000);
}
var button = buttons[i];
button.click();
wait(1000);
window.scrollTo(0, document.body.scrollHeight);
console.log(i + ' : Clicked' + ' --> ' + titles[i].textContent.trim());
i++;
}, 2000);
currentIntervals.push(currentInterval);
}
function closeToasts() {
let currentInterval = setInterval(function () {
let toasts = document.querySelectorAll('.artdeco-toast-dismiss');
toasts.forEach(toast => {
toast.click();
});
}, 500);
currentIntervals.push(currentInterval);
}
function stop() {
currentIntervals.forEach(currentInterval => {
clearInterval(currentInterval);
});
}
function start() {
followButtons();
closeToasts();
}
start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment