Skip to content

Instantly share code, notes, and snippets.

@spences10
Created October 1, 2017 13:38
Show Gist options
  • Save spences10/c45afc547a3d449513cac3a9d321ea47 to your computer and use it in GitHub Desktop.
Save spences10/c45afc547a3d449513cac3a9d321ea47 to your computer and use it in GitHub Desktop.
Remove existing LinkedIn relationships
;[ ...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