Jump to content
Nytro

Facebook Auto Like Script External Pages Code

Recommended Posts

Posted

Facebook Auto Like Script External Pages Code

/* ----------- USER CONFIGURATIONS ------------ */
$login_email = 'CHANGE THIS TO YOUR EMAIL';
$login_pass = 'CHANGE THIS TO YOUR PASSWORD';
$rssFeedToLike = "CHANGE THIS TO YOUR RSS FEED";
/* ------- END OF USER CONFIGURATIONS -------- */

# stories seen
$ss = Array();
$page = '';
$likephp = '';

function fblogin($page)
{
global $ch,$login_email,$login_pass;
curl_setopt($ch, CURLOPT_REFERER, 'http://www.facebook.com/plugins/like.php?href=http://fernandomagro.com');
curl_setopt($ch, CURLOPT_URL, 'http://www.facebook.com/login.php?api_key=9c2355ddad105c0767059b748e771bc6&skip_api_login=1&display=popup&social_plugin=like&external_page_url='.rawurlencode($page).'&next=http%3A%2F%2Fwww.facebook.com%2Fconnect%2Fuiserver.php%3Fsocial_plugin%3Dlike%26external_page_url%3D'.rawurlencode($page).'%26method%3Dopt.inlike%26display%3Dpopup%26app_id%3D127760087237610%26from_login%3D1');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'email=' . urlencode($login_email) . '&pass=' . urlencode($login_pass) . '&login=' . urlencode("Login"));
curl_setopt($ch, CURLOPT_POST, 1);
$login = curl_exec($ch);
# echo $login."\n\n\n\n\n";#debug
return $login;
exit;#debug
}

function fblikepage($page)
{
global $ch,$likephp;
curl_setopt($ch, CURLOPT_URL, 'http://www.facebook.com/plugins/like.php?href='.rawurlencode($page));
curl_setopt($ch, CURLOPT_POST, 0);
$likephp = curl_exec($ch);
preg_match("/Env=\{module:\"like_widget\",impid:\"([^\"]+)\",user\d+)/", $likephp, $fbvars);
return $fbvars;
}

// init curl
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_COOKIEJAR, "my_cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "my_cookies.txt");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4");

curl_setopt($ch, CURLOPT_URL, $rssFeedToLike);
curl_setopt($ch, CURLOPT_POST, 0);
$feed = curl_exec($ch);
preg_match_all("/<feedburnerrigLink>([^<]+)<\/feedburnerrigLink>/", $feed, $links);
#preg_match_all("/<link>([^<]+)<\/link>/", $feed, $links);

foreach ($links[1] as $link)
{
$fbvars = '';
$fbvars = fblikepage($link);
if ($fbvars[2] == 0)
{
if (preg_match("/Env=\{user:\d+/", $likephp))
{
echo "Could not like $link : no impid detected\n";
continue;
}
echo "Logging in...\n";
$page = fblogin($link);
$page = fblogin($link); # it's repeated on purpose, cookie trick.
$fbvars = fblikepage($link);
}

# print_r($fbvars);

# wrong password
if ($fbvars[2] == 0)
{
echo "Incorrect login user or password\n";
exit;
}

# impid, user, post_form_id, fb_dtsg
preg_match("/Env=\{module:\"like_widget\",impid:\"([^\"]+)\",user\d+).+?post_form_id:\"([^\"]+)\",fb_dtsg:\"([^\"]+)\",/", $likephp, $fbvars);
#print_r($fbvars);

curl_setopt($ch, CURLOPT_URL, 'http://facebook.com/ajax/connect/external_node_connect.php?__a=1');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'href='.rawurlencode($link).'&node_type=link&edge_type=like&page_id&layout=standard&connect_text&ref&now_connected=true&post_form_id='.$fbvars[3].'&nctr[_mod]=like_widget&nctr[_impid]='.$fbvars[1].'&fb_dtsg='.$fbvars[4].'&post_form_id_source=AsyncRequest');
curl_setopt($ch, CURLOPT_POST, 1);
$page = curl_exec($ch);
# echo $page;
echo "Liked $link\n";
}
?>

Sursa: Facebook Auto Like Script External Pages Code - r00tsecurity

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...