Last active
November 17, 2016 17:36
-
-
Save kussberg/0176ebec2f05560a72afb4a76a0b62a8 to your computer and use it in GitHub Desktop.
Facebook invite people, who liked the post
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
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