Last active
May 24, 2018 22:56
-
-
Save raphaeljolivet/7abf6b2f0da2e0802a9cb7d1f453125c to your computer and use it in GitHub Desktop.
Bookmarklet pour inviter à une page toutes les personnes ayant "liké" une publication.
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
javascript:(function(){ | |
var click = function(e){e.click()}; | |
var nbInvite = 0; | |
var exec = function() { | |
var invites = document.evaluate("a[contains('Invit')]", document, null, XPathResult.ANY_TYPE, null); | |
var invite | |
nbInvite += 1; | |
while ((invite = invites.iterateNext()) != null) { | |
invite.click(); | |
nbInvite += 1; | |
} | |
var pager = document.querySelectorAll("#reaction_profile_pager a.uiMorePagerPrimary"); | |
if (pager.length > 0) { | |
[].forEach.call(pager, click); | |
setTimeout(exec, 1000); | |
} else { | |
alert("Termine : " + nbInvite + " personnes invitees"); | |
} | |
}; | |
exec(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Installation :
Utilisation: