Created
October 1, 2017 13:38
-
-
Save spences10/c45afc547a3d449513cac3a9d321ea47 to your computer and use it in GitHub Desktop.
Remove existing LinkedIn relationships
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
;[ ...document.querySelectorAll('.mn-person-card') ].forEach((card) => { | |
// first pull out name and occupation | |
const name = card.querySelector('.mn-person-info__name').textContent | |
// console.log(name) | |
const headline = card.querySelector('.mn-person-info__occupation').textContent | |
// console.log(headline) | |
// find the button to remove connection | |
const dropdown = card.querySelector('.dropdown') | |
const showDelete = dropdown.querySelector('.show-delete-dialog-btn') | |
// const button = dropdown.querySelector('.remove') | |
// loop through the content | |
if (headline.match(/recruit/gi)) { | |
console.log(`nah ${name} looks dodgy!`) | |
console.log(dropdown) | |
dropdown.click() | |
// console.log(button) | |
console.log(showDelete) | |
} else { | |
console.log(`${name} looks cool`) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment