Skip to content

Instantly share code, notes, and snippets.

@vasanthk
Forked from wesbos/recruiters.js
Created May 19, 2016 08:20
Show Gist options
  • Select an option

  • Save vasanthk/488614b3a7cec0ff5cfa2a91e570480f to your computer and use it in GitHub Desktop.

Select an option

Save vasanthk/488614b3a7cec0ff5cfa2a91e570480f to your computer and use it in GitHub Desktop.

Revisions

  1. @wesbos wesbos created this gist May 17, 2016.
    14 changes: 14 additions & 0 deletions recruiters.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    [...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();
    }
    });