Skip to content

Instantly share code, notes, and snippets.

@kussberg
Last active November 17, 2016 17:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kussberg/0176ebec2f05560a72afb4a76a0b62a8 to your computer and use it in GitHub Desktop.
Save kussberg/0176ebec2f05560a72afb4a76a0b62a8 to your computer and use it in GitHub Desktop.
Facebook invite people, who liked the post
function invitePeople() {
// Invite first page users
var inputs = document.querySelectorAll('div._4t2a a._42ft._4jy0._4jy3._517h');
for(var i=1; i<inputs.length;i++) {
inputs[i].click();
}
// Are there more users?
var moreBtn = document.querySelector('div._4t2a a.pam.uiBoxLightblue.uiMorePagerPrimary');
if(moreBtn) {
moreBtn.click();
// Check if invite quota is exceeded, else continue
var error = document.querySelector('div._t');
if(error) return "I think too many likes!";
// Else continue to invite people to like the page
else return setTimeout(invitePeople, 5000);
} else {
return "Sucessfully finished!";
}
}
invitePeople();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment