Skip to content

Instantly share code, notes, and snippets.

@agungf
Last active August 29, 2015 14:07
Show Gist options
  • Save agungf/e850ed54c559baa531c7 to your computer and use it in GitHub Desktop.
Save agungf/e850ed54c559baa531c7 to your computer and use it in GitHub Desktop.
FB panpage auto invite
//click all friends link
var allFriends = document.getElementsByClassName('_5tef');
for(var i=0; i<allFriends.length;i++) {
allFriends[i].click();
console.log("allFriends link clicked!");
}
//scroll down every seconds
var showAll = setInterval(function() {
var objDiv = document.getElementsByClassName('_5tee');
var elements = objDiv[0].getElementsByTagName('li');
elements[elements.length - 1].scrollIntoView();
console.log("total friends displayed: ");
console.log(elements.length - 1);
}, 1000);
//delay invites for a minutes
setTimeout(function(){
console.log("processing to click invite buttons.....");
//stop scrolling
clearInterval(showAll);
//click every invites every second
var inputs = document.getElementsByClassName('_4jy0 _4jy3 _517h _42ft');
var clicked = 0;
for(var i=0; i<inputs.length;i++) {
inputs[i].click();
clicked++;
console.log(i+" ok!");
}
console.log(clicked+" clicked to invite!");
console.log("done !");
}, 60*1000);
@agungf
Copy link
Author

agungf commented Sep 29, 2014

Note

What it does?

Inviting as much as possible friends to your FB fan page.

How to:

  1. open fanpage using chrome browser
  2. open console (f12)
  3. copy and paste above script
  4. run (press enter)

Scripts steps:

  1. click show all friends
  2. scrolling down to show as much as possible uninvited friends (wait for 1 minutes)
  3. click the invite button

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment