03 January 2012

Facebook auto like script

facebook auto like script is a php script that allows liking friend’s posts or an external page or all posts in a facebook page with some level of randomness. The script comes in two versions, like friends posts (iterates an user wall to like friends’ posts) and like external pages (iterates a rss feed to retrieve external links to like).

Important update: if you’re looking for a way to automatically STEAL facebook likes from users that visit your website, then you should also read my facebook clickjacking howto blog post. I wrote it to raise awareness for this issue. You should try to understand it and focus on how to prevent it.

Like friends posts

The script runs in background and iterates a user’s facebook page every random seconds to see if there are new posts added, if so there is a coin-flip with a user-defined probability value to see if those posts should be liked.

Like Friends Posts configurations
$login_email = "CHANGE THIS TO your-login-email";
$login_pass = "CHANGE THIS TO your-password";
$users = Array(
"CHANGE THIS TO A FRIEND'S USERNAME" => 0.5,
"CHANGE THIS TO A FRIEND'S USERNAME" => 0.9,
"CHANGE THIS TO A FRIEND'S USERNAME" => 0.4,
"CHANGE THIS TO A FRIEND'S USERNAME" => 0.2,
);

That means that username1′s posts will have a 50% chance to be liked, username2′s posts will have 90% chance to be liked, and so on.
Remember to change your-login-email and your-password with the actual email and facebook password.

Like Friends Posts Code

Updated 11/01/2011

CODE REMOVED MARCH 1, 2011 BY FACEBOOK'S REQUEST -- check out the letter they sent me

I asked that for taking down the code they'd donate 5000€ for charity. Unfortunately I didn't get any response from the lawyers until now but I'll remove the code anyway (I'm just a nice guy).

Like External Pages


Like external pages is using an url like http://www.facebook.com/plugins/like.php?href=some_URL to inject a list of urls automatically without human interaction.

Like External Pages configurations
CODE REMOVED MARCH 1, 2011 BY FACEBOOK'S REQUEST -- check out the letter they sent me

I asked that for taking down the code they'd donate 5000€ for charity. Unfortunately I didn't get any response from the lawyers until now but I'll remove the code anyway (I'm just a nice guy).

Like External Pages tweaks

You can tweak your script to work with the different types of rss feeds. Right now it’s optimized for feedburner where there is a , however you can comment that line on the script and uncomment the line referring to if you have some other type of rss feed. Locate the following in the above script:

#preg_match_all("/<feedburner:origLink>([^<]+)<\/feedburner:origLink>/", $feed, $links);
preg_match_all("/<link>([^<]+)<\/link>/", $feed, $links);

Like all posts in a facebook wall page


By user request I made a modification in the initial script so that it crawls a facebook page and goes 5 pages deep liking every post it finds. To set it up, you need to change the header of the script like the other ones, but now there’s something else because you’ll have to fill in the page you want to crawl.

1º Go to the page you want to crawl
2º Copy the URL
3º Paste the url in $fbpage
4º Change www.facebook.com to m.facebook.com

Important notes as of 23/Jan/2011: facebook blocks liking several posts at once from a certain page, so I added a sleep timer so the urls are not fetched all at once, not sure it will help; You must remember to like the page itself before liking its posts, otherwise the like button won’t be available for the posts and the script won’t see it.

Dummies and windows users


1º Install PHP windows binaries
2º During the installation select “Do not setup a web server”
3º Download the script you wish from this post
4º Open it with WORDPAD (must be wordpad, notepad will give you everything without newlines)
5º Change the first lines of the script where it says /* ———– USER CONFIGURATIONS ———— */
6º Open cmd.exe (Start menu -> run -> cmd)
7º Locate the path where you extracted the script, example: C:\fbautolike\fbautolike.php
8º Type number 9º
9º php C:\fbautolike\fbautolike.php

Note: if you get a message saying “Could not open input file” then you’re typing the path wrong. To check if PHP is installed correctly, type: php -v

No comments:

Post a Comment