Created
May 17, 2016 14:42
-
-
Save wesbos/c616873c40ac258d0e028587f8185e56 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
[...document.querySelectorAll('.invite-card')].forEach(card => { | |
const headline = card.querySelector('.headline').textContent; | |
const accept = card.querySelector('.bt-invite-accept'); | |
const decline = card.querySelector('.bt-invite-decline'); | |
const name = card.querySelector('.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