Automating the Removal of LinkedIn Connections
So on changing my career ambitions from the banking industry to computer software, I decided to update my LinkedIn profile after about 2 years since the switch. I had so many connections, close to 800, that are not relevant to my
new ambitions at all. I had to remove them. I removed about 5 of them manually and the lazy bit of me was already complaining.
So I set back and wrote a script to help me remove them.
With that, I was able to remove about 3-4 contacts per second. In less than 4min, I was down to a fresh start. I closed the LinkedIn browser tab so that the `setInterval` stops running and opened a fresh one. 😉
What a quack hack!! 😂We can use that in other places too where bulk removal is not an option; just adjust the script to match their proper query selectors.
So I set back and wrote a script to help me remove them.
function removeConnection() { setInterval(function() { // click ellipsis document.querySelector('[data-control-name="ellipsis"]').click(); // click delete button setTimeout(function() { document.querySelector('li[class*="delete"] button').click(); // click the confirm button setTimeout(function() { document.querySelector('[data-control-name="confirm_removed"]').click(); }, 100); }, 100); }, 250); } removeConnection();I open LinkedIn, hit `My Network` and then `Connections`. Opened developer tools to access the browser console and pasted the script and hit Return on my Keyboard.
With that, I was able to remove about 3-4 contacts per second. In less than 4min, I was down to a fresh start. I closed the LinkedIn browser tab so that the `setInterval` stops running and opened a fresh one. 😉
What a quack hack!! 😂We can use that in other places too where bulk removal is not an option; just adjust the script to match their proper query selectors.
Comments
Post a Comment