Last active
June 22, 2019 10:14
-
-
Save EgidioCaprino/24fb48224984c8f477b7ae148e1296b4 to your computer and use it in GitHub Desktop.
Run this script on https://www.linkedin.com/mynetwork/invite-connect/connections/ to remove all your connections. You may need to run it more than once.
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
(($) => { | |
'use strict'; | |
const click = button => new Promise(resolve => { | |
$(button).click(resolve).trigger('click'); | |
}); | |
const sleep = timeout => new Promise(resolve => setTimeout(resolve, timeout)); | |
const process = async () => { | |
const dotButtons = $('.dropdown-trigger.mn-connection-card__dropdown-trigger.ember-view'); | |
if (dotButtons.length) { | |
await dotButtons.toArray().reduce( | |
(promise, button) => promise.then(async () => { | |
await click(button); | |
const removeConnectionButton = $('.display-flex.align-items-center.t-14.t-black--light.t-normal')[0]; | |
await click(removeConnectionButton); | |
const removeButton = $('.mv2.artdeco-button.artdeco-button--2.artdeco-button--primary.ember-view')[0]; | |
await click(removeButton); | |
await sleep(500); | |
}), | |
Promise.resolve(), | |
); | |
await sleep(2000); | |
await process(); | |
} | |
}; | |
process(); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment