Created
January 10, 2024 20:27
-
-
Save SHi-ON/133f22562a56b9e009ec619f0e79a633 to your computer and use it in GitHub Desktop.
Unfollow LinkedIn Pages in bulk. Inspired by https://mighil.com/mass-unfollow-linkedin-connections/
This file contains hidden or 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
(() => { | |
let count = 0; | |
function getAllButtons() { | |
return document.querySelectorAll('button.artdeco-button--2.artdeco-button--secondary') || []; | |
} | |
async function unfollowAll() { | |
const buttons = getAllButtons(); | |
for (let button of buttons) { | |
if (button){ | |
button.click(); | |
await new Promise((resolve) => setTimeout(resolve, 100)); | |
const b_unfollow = document.querySelector('button.artdeco-button--2.artdeco-button--primary.artdeco-modal__confirm-dialog-btn'); | |
if (b_unfollow){ | |
b_unfollow.click(); | |
await new Promise((resolve) => setTimeout(resolve, 100)); | |
count = count + 1; | |
console.log(`Unfollow #${count}`); | |
} | |
} | |
await new Promise((resolve) => setTimeout(resolve, 100)); | |
} | |
window.scrollTo(0, 260); | |
} | |
async function run() { | |
await unfollowAll(); | |
window.scrollTo(0, document.body.scrollHeight); | |
await new Promise((resolve) => setTimeout(resolve, 1000)); | |
const buttons = getAllButtons(); | |
if (buttons.length) run(); | |
} | |
run(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment