Last active
May 30, 2018 14:19
-
-
Save mehmetkurt/a299af25a6914f4dd5ba9597ff90907e to your computer and use it in GitHub Desktop.
LinkedIn Bulk Invite : LinkedInHack
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
/* | |
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