Skip to content

Instantly share code, notes, and snippets.

@guiliredu
Last active November 4, 2025 16:28
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(); } } }
@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?

@Shurshik
Copy link

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

As I know there is no working open source version. Now only the paid one works perfectly, free version isn't good anymore

@raihanhosen011
Copy link

raihanhosen011 commented Feb 18, 2025

This script automates inviting people to like your Facebook page.

👉 open the invite modal
👉 paste the script into the browser console
👉 and press enter

⚠️ To keep your account safe, the script will send 100 invites at a time. After reaching the limit, you should wait for some time before running it again

(async()=>{let e=0,t=100,o=0,l=20;function n(e,t){return Math.floor(Math.random()*(t-e+1)+e)*1e3}while(o<l&&e<t){let l=document.querySelectorAll('div[aria-label="Invite"]');if(0===l.length)console.log("No more invites found. Scrolling...");else for(let i of l){if(e>=t)return void console.log("🚀 Done! 100 invites sent.");i.click(),e++,console.log(✅ Invited: ${e}),await new Promise(e=>setTimeout(e,n(2,4)))}let i=document.querySelectorAll('div[aria-label="Invite"]');if(i.length>0)i[i.length-1].scrollIntoView({behavior:"smooth",block:"end"}),console.log("⬇ Scrolling to load more invites...");else{console.log("❌ No more invite buttons found to scroll.");break}await new Promise(e=>setTimeout(e,n(2,4))),o++}console.log("🎉 Finished inviting as many as possible!")})();

@Shurshik
Copy link

I personally prefer to use an extension that scans all posts automatically, much much better and easier :) anyway, yes, for small pages code can be used too

@Jacobateh
Copy link

I personally prefer to use an extension that scans all posts automatically, much much better and easier :) anyway, yes, for small pages code can be used too

please what tool do you use ?

@Milka68
Copy link

Milka68 commented Nov 4, 2025 via email

@Shurshik
Copy link

Shurshik commented Nov 4, 2025

I personally prefer to use an extension that scans all posts automatically, much much better and easier :) anyway, yes, for small pages code can be used too

please what tool do you use ?

I use this one: invitelikecomment.com

@clickable101
Copy link

clickable101 commented Nov 4, 2025

seems it no longer works
tried using this it didnt work__avascript: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(); } } }

@clickable101
Copy link

(async()=>{let e=0,t=100,o=0,l=20;function n(e,t){return Math.floor(Math.random()*(t-e+1)+e)*1e3}while(o<l&&e<t){let l=document.querySelectorAll('div[aria-label="Invite"]');if(0===l.length)console.log("No more invites found. Scrolling...");else for(let i of l){if(e>=t)return void console.log("🚀 Done! 100 invites sent.");i.click(),e++,console.log(✅ Invited: ${e}),await new Promise(e=>setTimeout(e,n(2,4)))}let i=document.querySelectorAll('div[aria-label="Invite"]');if(i.length>0)i[i.length-1].scrollIntoView({behavior:"smooth",block:"end"}),console.log("⬇ Scrolling to load more invites...");else{console.log("❌ No more invite buttons found to scroll.");break}await new Promise(e=>setTimeout(e,n(2,4))),o++}console.log("🎉 Finished inviting as many as possible!")})();

please how do i use it

@clickable101
Copy link

I personally prefer to use an extension that scans all posts automatically, much much better and easier :) anyway, yes, for small pages code can be used too

please what tool do you use ?

I use this one: invitelikecomment.com

Your tool is quite expensive. kindly review price

@Shurshik
Copy link

Shurshik commented Nov 4, 2025

I personally prefer to use an extension that scans all posts automatically, much much better and easier :) anyway, yes, for small pages code can be used too

please what tool do you use ?

I use this one: invitelikecomment.com

Your tool is quite expensive. kindly review price

This is not my tool. I used the free version, it can invite 300 users per day, but last Black Friday I purchased a 3 years version, which had like 85% of discount or something, and instead of just 1 posts it scans all posts automatically

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