Created
April 17, 2025 13:20
-
-
Save dante4rt/d18cab065f4c968e0d57673574eedd19 to your computer and use it in GitHub Desktop.
This JavaScript snippet automates the process of unfollowing all users on LinkedIn's following page (https://www.linkedin.com/mynetwork/network-manager/people-follow/following/). It continuously checks for "Following" buttons, clicks them to unfollow users, and scrolls to load more users until all users are unfollowed.
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
(function unfollowAll() { | |
const followingButtons = document.querySelectorAll("span.artdeco-button__text"); | |
if (followingButtons.length === 0) { | |
console.log("No more 'Following' buttons found."); | |
return; | |
} | |
followingButtons.forEach((button) => { | |
if (button.innerText === "Following") { | |
button.click(); | |
console.log("Clicked 'Following'"); | |
} | |
}); | |
window.scrollTo(0, document.body.scrollHeight); | |
console.log("Scrolled down"); | |
setTimeout(unfollowAll, 2000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment