Last active
February 7, 2018 05:38
-
-
Save ticidesign/4e9cc6d8ac9dc1359cc082793dd0315e to your computer and use it in GitHub Desktop.
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
//Fight LinkdIn Recruiter Spam with JavaScript! | |
[...document.querySelectorAll('.mn-invitation-card')].forEach(card => { | |
const headline = card.querySelector('.mn-person-info__occupation').textContent; | |
const accept = card.querySelector('button[data-control-name="accept"]'); | |
const decline = card.querySelector('button[data-control-name="decline"]'); | |
const name = card.querySelector('.mn-person-info__name').textContent; | |
if(headline.match(/recruit/gi)) { | |
console.log(`Nah. ${name} looks a little fishy to me. 🐡`); | |
decline.click(); | |
} else { | |
console.log(`${name} looks cool. Let them in! 😎`); | |
accept.click(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment