Skip to content

Instantly share code, notes, and snippets.

@guiliredu
Last active May 3, 2024 21:49
Show Gist options
  • Save guiliredu/ef83ac2c81452a7116956f3fd73b406d to your computer and use it in GitHub Desktop.
Save guiliredu/ef83ac2c81452a7116956f3fd73b406d to your computer and use it in GitHub Desktop.
Facebook - Script to auto invite people who liked a page post do like the page
var buttons;
buttons = document.getElementsByClassName('_42ft');
for (var i = 0; i < buttons.length; i++) {
if(buttons[i].getAttribute('ajaxify') != null){
if(buttons[i].getAttribute('ajaxify').indexOf('invite') != -1){
buttons[i].click();
}
}
}

How to use

  • Open the facebook window with people yuo want to invite
  • Copy the code and place on your browser url input OR open console and place
  • To use in the browser url input, copy the code below:
javascript:var buttons; buttons = document.getElementsByClassName('_42ft'); for (var i = 0; i < buttons.length; i++) { if(buttons[i].getAttribute('ajaxify') != null){ if(buttons[i].getAttribute('ajaxify').indexOf('invite') != -1){ buttons[i].click(); } } }
@GHSkyKam
Copy link

GHSkyKam commented Aug 3, 2020

This will not work. Facebook will disable invite pretty quickly.

I don't know, I manage a medium size page and I use it everyday. Of course your mileage may vary.

The key is exposing all the Invite buttons before deploying this script, because facebook count this as one single click. You can use an autohotkey script to do this.

#j::   ; Windows-J

; Keeps scrolling down until the shift key is pressed
loop {
  Send {WheelDown 4000} ; scroll down
  Sleep 500
  if (GetKeyState("Shift")) 
     break
}
; Move the mouse to the right a little to indicate that the script ended
MouseMove 800,0,,R

return

@Ceasarsalad-Code
Copy link

Yes, we need timeout between clicks, but there is a free extension, as I post before, so people can use it :)

It's very useful, But what is the time out between clicks ?

@Shurshik
Copy link

Shurshik commented Sep 1, 2020

Yes, we need timeout between clicks, but there is a free extension, as I post before, so people can use it :)

It's very useful, But what is the time out between clicks ?

Random about 2-4 seconds. And also you can change it in some versions

@Shurshik
Copy link

Some useful updates I found:

  1. BIG pages (more than 100 000 likes) can now invite post likers again in the new interface!
  2. If you don't like new interface - just use this extension: https://chrome.google.com/webstore/detail/switch-to-classic-design/oancckmjgaoejmbedngcoiakblhacbog and it will re-enable classic version on your browser!

@andrecostamarques
Copy link

Is there anyway to invite someone whom liked a page your not the owner?

@netusipt
Copy link

netusipt commented Aug 23, 2021

I highly recommend this browser extension - Firefox, Chrome, Edge.
It saves me so much time and it's free.

@Shurshik
Copy link

I highly recommend this browser extension - Firefox, Chrome, Edge.
It saves me so much time and it's free.

I can see the malware there. THis extension was just uploaded. DO NOT USE IT. Just search on google and use famous extensions released years ago with thousands on downloads, you will be more secure.

@netusipt
Copy link

It's not malware. Look at the reviews on Firefox. I developed this extension. I build it primarily for my own use. Recently I decided to share it with others. It's just another option. Download whatever extension you want. Just saying it's not malware, it works and it's free. Actually, all extensions are reviewed before they are published. Here's my website - https://likeinviter.herokuapp.com/

@Shurshik
Copy link

It's not malware. Look at the reviews on Firefox. I developed this extension. I build it primarily for my own use. Recently I decided to share it with others. It's just another option. Download whatever extension you want. Just saying it's not malware, it works and it's free. Actually, all extensions are reviewed before they are published. Here's my website - https://likeinviter.herokuapp.com/

Reviews? There is 1 good review, lol! I don't see any sense to create own extension when there are many of them, for years. Also no sense to give the extension access to your own domain, it's not secure. Google checks extension but not enough. For me this is big no.

@piranhap
Copy link

2024 and wondering what everyone else is using ;-;

@Shurshik
Copy link

2024 and wondering what everyone else is using ;-;

I use this paid extension: https://www.invitelikecomment.com/en/ at the end it was better to pay and be sure the extension is safe, this link is here since 2019 and still works

@piranhap
Copy link

piranhap commented May 3, 2024

I understand but part of me feels like there's gotta be some free open-source version for a script, right?

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