Skip to content

Instantly share code, notes, and snippets.

@lexoyo
Last active December 1, 2023 13:39
Show Gist options
  • Save lexoyo/d8ef5189864cb007d34442d96a82d78e to your computer and use it in GitHub Desktop.
Save lexoyo/d8ef5189864cb007d34442d96a82d78e to your computer and use it in GitHub Desktop.
mass invite to a linkedin page
// open https://www.linkedin.com/company/71787366/admin/?invite=true
// Paste this in the console:
const from = 800
const to = from + 250
const el = document.querySelector('.invitee-picker__results-container')
let done = false
let prevNum = 0
function do_me() {
setTimeout(() => {
el.scrollTo(0, 0)
setTimeout(() => {
el.scrollTo(0, 900000)
setTimeout(() => {
const num = Array.from(document.querySelectorAll('.ember-checkbox')).length
console.log(`${num} contacts are visible`)
if(done || num > to || prevNum === num) {
done = true
invite()
} else do_me()
prevNum = num
}, 10000)
}, 500)
}, 500)
}
function invite() {
const arr = Array.from(document.querySelectorAll('.ember-checkbox'))
console.log(`Start invites of ${arr.length} people`)
arr
.slice(from, to)
.forEach(el => el.click())
console.log('Done. Click "invite"!')
}
do_me()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment