Skip to content

Instantly share code, notes, and snippets.

@brunolemos
Last active February 3, 2024 05:47
Show Gist options
  • Star 87 You must be signed in to star a gist
  • Fork 17 You must be signed in to fork a gist
  • Save brunolemos/8e13c5472b0c07d795aa766423569546 to your computer and use it in GitHub Desktop.
Save brunolemos/8e13c5472b0c07d795aa766423569546 to your computer and use it in GitHub Desktop.
Unfollow everyone on Linkedin
(() => {
let count = 0;
function getAllButtons() {
return document.querySelectorAll('button.is-following') || [];
}
async function unfollowAll() {
const buttons = getAllButtons();
for (let button of buttons) {
count = count + 1;
const name = button.parentElement.querySelector(
'.follows-recommendation-card__name',
).innerText;
console.log(`Unfollow #${count}:`, name);
window.scrollTo(0, button.offsetTop - 260);
button.click();
await new Promise((resolve) => setTimeout(resolve, 100));
}
}
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();
})();
@slorber
Copy link

slorber commented May 18, 2020

For people just having this gist link:

  1. Open https://linkedin.com/feed/following/
  2. Open Dev Tools > Console (Cmd+Option+J)
  3. Paste the script & press enter

Original Tweet: https://twitter.com/brunolemos/status/1260675970471800832

Copy link

ghost commented Apr 6, 2022

@slorber how to modify it to be matched with Withdraw botto
Web capture_6-4-2022_215258_www linkedin com
n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment