Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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(); } } }
@kdelev71

This comment has been minimized.

Copy link

@kdelev71 kdelev71 commented Mar 29, 2017

Honestly, thank you so much. Saves me loads of time!

@fourg6x

This comment has been minimized.

Copy link

@fourg6x fourg6x commented Apr 2, 2017

Wonder if it could be modified to also click the Load More button (to pull in more people to invite)

@Shurshik

This comment has been minimized.

Copy link

@Shurshik Shurshik commented Apr 12, 2017

There is an extension in chrome that also clicks "See more" if post has more than 50 likes. And it works in the same way - using just a js. https://chrome.google.com/webstore/detail/oobofacgjpheigmglnjjlhfolhcamaia

@fourg6x

This comment has been minimized.

Copy link

@fourg6x fourg6x commented Apr 19, 2017

Awesome, will check that out! Thanks @Shurshik

@orjiakor

This comment has been minimized.

Copy link

@orjiakor orjiakor commented May 12, 2017

How do I use this script, can you share guideline please?

@Milka68

This comment has been minimized.

Copy link

@Milka68 Milka68 commented May 12, 2017

There are different extensions now. I prefer one with custom timeouts so I can set them as I like, it is a new one: https://chrome.google.com/webstore/detail/facebook-fan-inviter-cust/nadkillaoaocaambipdgoookeaghjeik

@Shurshik

This comment has been minimized.

Copy link

@Shurshik Shurshik commented Jun 5, 2017

Now there is also an extension that expands all comments and search for likes in comments. Maybe it will be useful for someone: https://chrome.google.com/webstore/detail/facebook-auto-invite-who/pllfhgnffplcibjagjffpnjkpegdlede

@geongeorge

This comment has been minimized.

Copy link

@geongeorge geongeorge commented Jun 9, 2017

I use this an I'm in love with it. I crossed more than 500 invites per day with this baby :
Facebook Post Likers Inviter

@geongeorge

This comment has been minimized.

@Shurshik

This comment has been minimized.

Copy link

@Shurshik Shurshik commented Jun 9, 2017

Facebook Post Likers Inviter - is paid version of a free tool. I use Facebook Fan Inviter - custom timeouts, from description:

  • Open Posts tab and run it to invite everyone who liked any of your posts.
  • Open Friend list and run it to invite friends.
  • Open Photos tab to invite who liked any of your photos.

https://chrome.google.com/webstore/detail/facebook-fan-inviter-cust/nadkillaoaocaambipdgoookeaghjeik

@MarinaTerres

This comment has been minimized.

Copy link

@MarinaTerres MarinaTerres commented Jun 18, 2017

Thank you for the link! This FREE tool is awesome:
Invite post likers to like your fan page
and then I tried a pro version, just run it and it scanned all my 400 posts, love it too much

@AlesandroPack

This comment has been minimized.

Copy link

@AlesandroPack AlesandroPack commented Jul 8, 2017

We have more than one page, so we use a Multi-Pages extension that also has an option of Real-Time inviting. It is more expensive but we save hours of time each day and invite a lot of people, so we win. Video: https://www.youtube.com/watch?v=IZe2bAjsYq0

@alerioja

This comment has been minimized.

@Shurshik

This comment has been minimized.

Copy link

@Shurshik Shurshik commented Jul 30, 2017

DO NOT use the link posted by alerioja it invites too fast and Facebook just blocks you. Using this free tool: https://chrome.google.com/webstore/detail/oobofacgjpheigmglnjjlhfolhcamaia it clicks every second so you don't get blocked. I also use pro version, just run it and it checks all post of all my pages every day

@Shurshik

This comment has been minimized.

Copy link

@Shurshik Shurshik commented Aug 3, 2017

You can find ALL possible programs for this feature here: https://www.invitelikecomment.com/

@AlesiaZeta

This comment has been minimized.

Copy link

@AlesiaZeta AlesiaZeta commented Oct 7, 2017

Hi smart people! Please help me! ! Do you know why people (from ad boost likers and my friends) do NOT get any notifications from me to like my page ? i used this great tool to grow my followers list in the past inviting them manually, now i installed "Chrome fb inviter" and still no luck.. never happened before and always respected the limits. Fb help center never replied, i contacted them more than once...:-//// Pls help me! so frustrating...

@lequanghiep2011

This comment has been minimized.

Copy link

@lequanghiep2011 lequanghiep2011 commented Oct 14, 2017

Hello,
I saw this code:
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(); } } }

But i dont know how to use, could some one helpme?

@Shurshik

This comment has been minimized.

Copy link

@Shurshik Shurshik commented Oct 14, 2017

lequanghiep2011,
it's very old code and you will be banned for 1 day if you use it, because it has NO timeouts, use this FREE-noads tool (it's much better):
https://chrome.google.com/webstore/detail/oobofacgjpheigmglnjjlhfolhcamaia

@guiliredu

This comment has been minimized.

Copy link
Owner Author

@guiliredu guiliredu commented Nov 6, 2017

Hey guys, I wrote this code 2 years ago. Some here said that running this Facebook will block you, so use it with caution.

@Shurshik

This comment has been minimized.

Copy link

@Shurshik Shurshik commented Nov 7, 2017

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

@AlexCalin

This comment has been minimized.

Copy link

@AlexCalin AlexCalin commented Feb 25, 2018

This one is the best extension! I am very happy to find it. Also, I've downloaded other scripts of this company to auto-reply on reviews, comments, shared posts etc.
this one is free: https://chrome.google.com/webstore/detail/oobofacgjpheigmglnjjlhfolhcamaia

@tribal2

This comment has been minimized.

Copy link

@tribal2 tribal2 commented Sep 14, 2018

Thanks! 😈
image

@ilMagnifico

This comment has been minimized.

Copy link

@ilMagnifico ilMagnifico commented Apr 11, 2019

Hi @guiliredu and thanks for the code,
I was wondering if you can do more, that is, is there a tool that automatically does it for your last posts?
Automating this boring action.

@Shurshik

This comment has been minimized.

Copy link

@Shurshik Shurshik commented May 7, 2019

@ilMagnifico check this scripts: https://www.invitelikecomment.com/en/ you can scan ALL your posts of all your pages automatically with random intervals.

@sebastiankayser

This comment has been minimized.

Copy link

@sebastiankayser sebastiankayser commented May 29, 2019

Hey guys, I've just tested the https://www.fblikeinviter.com PRO version. I have a little FB page to share my blog posts and recently more and more people are coming in who like the posts there. I was tired of manually inviting them and the PRO version does exactly what I was looking for. I installed the extension, opened up my FB page and it scanned the posts for people that liked (and thus should be invited).

It has a built-in throtteling mechanism, so that you don't get blocked by Facebook. Okay, it's not super-cheap (6 USD / month), but for me it's simply excellent, because I don't have to manually bother with sending out invites. Highly recommended!

@SalimF

This comment has been minimized.

Copy link

@SalimF SalimF commented Oct 23, 2019

I modify the code to have delay 1s you dodn;t nee any sht PRO addons for that here is the cod

javascript:var buttons; var i = 1; buttons = document.getElementsByClassName('_42ft'); function myLoop () { setTimeout( function () { if(buttons[i].getAttribute('ajaxify') != null){ if(buttons[i].getAttribute('ajaxify').indexOf('invite') != -1){ buttons[i].click(); } } i++ ; if (i < 10) { myLoop() ; } } , 1000 ) } myLoop();

@guiliredu

This comment has been minimized.

Copy link
Owner Author

@guiliredu guiliredu commented Oct 24, 2019

I modify the code to have delay 1s you dodn;t nee any sht PRO addons for that here is the cod

javascript:var buttons; var i = 1; buttons = document.getElementsByClassName('_42ft'); function myLoop () { setTimeout( function () { if(buttons[i].getAttribute('ajaxify') != null){ if(buttons[i].getAttribute('ajaxify').indexOf('invite') != -1){ buttons[i].click(); } } i++ ; if (i < 10) { myLoop() ; } } , 1000 ) } myLoop();

Thanks, dude, will update the code with your timeout idea.

@SalimF

This comment has been minimized.

Copy link

@SalimF SalimF commented Oct 24, 2019

Thanks, dude, will update the code with your timeout idea.

BTW I didn't doing complete test on it , as it's do not have scroll feature to see more likes , Anyway you all should be aware of this methods since I got warning from FB for spam even I was using delay , I guess FB think you won't sent invite to more than 80% of people who like your post . Last I use this add-on now https://chrome.google.com/webstore/detail/invite-post-likers-to-lik/dfhnkeijhilolcebpchcdiclpejojodb/

@KareemElhennawy

This comment has been minimized.

Copy link

@KareemElhennawy KareemElhennawy commented Jan 8, 2020

Hi all,

I'm facing this issue

image

@rohitcoder

This comment has been minimized.

Copy link

@rohitcoder rohitcoder commented Jan 14, 2020

is there any alternative for server-side scripts? i want to run CRON jobs, i don't think it's possible with JS.

@SalimF

This comment has been minimized.

Copy link

@SalimF SalimF commented Jan 14, 2020

i don't think it's possible with JS.

You can use PhantomJS or Headless Chrome ( and inject/load JS code to it ) if PhantomJS didn't work and run it from any linux server via command line , BTW you need to increase the delay time a lot since you're using (server which runs 24/7) or better you could make the script pause the invitation for hours and make the account do anything else , son didn't get suspended from facebook .

@neojin12355

This comment has been minimized.

Copy link

@neojin12355 neojin12355 commented Mar 8, 2020

Thank you so much ! So saved me hours of repetitive work !

@Mishef

This comment has been minimized.

Copy link

@Mishef Mishef commented Mar 22, 2020

Hello everyone! Is there a new version of a script that works with new Facebook design?

@BaapJaan

This comment has been minimized.

Copy link

@BaapJaan BaapJaan commented Apr 13, 2020

I did this one Credit goes to Shahriar Shojib

async function invite() {
	let 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) {
				await timeout(Math.ceil(Math.random() * 10000));
				buttons[i].click();
			}
			
		}
	}

}
function timeout(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}
invite();
@Mishef

This comment has been minimized.

Copy link

@Mishef Mishef commented Apr 13, 2020

@BaapJaan It didn't let me to insert that code into URL address of bookmark in Chrome.

@BaapJaan

This comment has been minimized.

Copy link

@BaapJaan BaapJaan commented Apr 22, 2020

@BaapJaan It didn't let me to insert that code into URL address of bookmark in Chrome.

Insert it in your console How?

@Shurshik

This comment has been minimized.

Copy link

@Shurshik Shurshik commented May 14, 2020

@BaapJaan It didn't let me to insert that code into URL address of bookmark in Chrome.

Insert it in your console How?

You cannot use the code in console anymore, it's more complicated, just download and use any extension like this (with top reviews): https://chrome.google.com/webstore/detail/oobofacgjpheigmglnjjlhfolhcamaia?hl=en

@Shurshik

This comment has been minimized.

Copy link

@Shurshik Shurshik commented May 14, 2020

Hello everyone! Is there a new version of a script that works with new Facebook design?

The one I use in chrome works with the new design very well

@Agostinho78

This comment has been minimized.

Copy link

@Agostinho78 Agostinho78 commented Jun 15, 2020

Is there a script to invite anyone whole LIKED somebody else's page or group to come LIKE my page:

Thanks,
Agostinho Domingos
Founder, CEO, Director
https://www.ladilsa.com

@Shurshik

This comment has been minimized.

Copy link

@Shurshik Shurshik commented Jun 15, 2020

Is there a script to invite anyone whole LIKED somebody else's page or group to come LIKE my page:

You are asking for an impossible thing. There is no way to invite people from other pages.

@GHSkyKam

This comment has been minimized.

Copy link

@GHSkyKam GHSkyKam commented Aug 2, 2020

The code could be further simplified to this one-liner for the Chrome address bar.

Note that it won't work with a simple copy and paste into the address bar because Chrome blocks any string that starts with javascript: in the address bar. Select from the second character onward, manually type "j" in the address, paste in what you copied, and hit enter.

javascript:(function() {Array.from(document.getElementsByClassName('_42ft')).map(function(x){x&&x.getAttribute('ajaxify')&&x.getAttribute('ajaxify').indexOf('invite')!=-1&&x.click();});})();

@Shurshik

This comment has been minimized.

Copy link

@Shurshik Shurshik commented Aug 2, 2020

The code could be further simplified to this one-liner for the Chrome address bar.

Note that it won't work with a simple copy and paste into the address bar because Chrome blocks any string that starts with javascript: in the address bar. Select from the second character onward, manually type "j" in the address, paste in what you copied, and hit enter.

javascript:(function() {Array.from(document.getElementsByClassName('_42ft')).map(function(x){x&&x.getAttribute('ajaxify')&&x.getAttribute('ajaxify').indexOf('invite')!=-1&&x.click();});})();

This will not work. Facebook will disable invite pretty quickly. You need to use random timing on clicking and on scrolling... The best way is to use any free script, there are hundreds of them as extensions in chrome store

@GHSkyKam

This comment has been minimized.

Copy link

@GHSkyKam 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

This comment has been minimized.

Copy link

@Ceasarsalad-Code Ceasarsalad-Code 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 ?

@Shurshik

This comment has been minimized.

Copy link

@Shurshik 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

This comment has been minimized.

Copy link

@Shurshik Shurshik commented Sep 21, 2020

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

This comment has been minimized.

Copy link

@andrecostamarques andrecostamarques commented Jun 9, 2021

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

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