Created
April 6, 2017 04:01
-
-
Save trungpv1601/ed62f921d58e491de96c9c1d3f8d06bc to your computer and use it in GitHub Desktop.
Invite people like post like page facebook
This file contains hidden or 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
// Go to post page -> click show popup people like post -> run script | |
// 04/06/2017 | |
var keepContinue = 0; | |
var cancel = setInterval(function(){ | |
keepContinue++; | |
var seeMore = document.getElementsByClassName('pam uiBoxLightblue uiMorePagerPrimary'); | |
if(seeMore.length == 1) { | |
seeMore[0].click(); | |
} else { | |
inviteAll(); | |
} | |
console.log(keepContinue); | |
}, 2000) | |
function inviteAll(){ | |
clearInterval(cancel); | |
var buttons; | |
buttons = document.getElementsByClassName('_42ft _4jy0 _4jy3 _517h _51sy'); | |
var i = 0; | |
(function loop(){ | |
if (i++ > buttons.length) return; | |
setTimeout(function(){ | |
console.log('[' + i + ']'); | |
console.log(buttons[i]); | |
if(buttons[i].getAttribute('ajaxify') != null){ | |
if(buttons[i].getAttribute('ajaxify').indexOf('invite') != -1){ | |
buttons[i].click(); | |
console.log('Clicked'); | |
} | |
} | |
loop(); | |
}, 1500); | |
})(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment