Facebook评论类似的脚本不再起作用了。为什么?

时间:2013-11-29 09:07:32

标签: php facebook curl facebook-like facebook-comments

前几天我试图让这个脚本工作。我认为它工作了3个星期。现在它在我拥有的任何服务器上都不再有效。我试过的其他提供商也没有用。

我收到以下错误:

for (;;);{"__ar":1,"error":1357032,"errorSummary":"Leider ist etwas schief gelaufen","errorDescription":"Bitte versuche, diese Seite neu zu laden oder schlie\u00dfe dein Browserfenster und \u00f6ffne es erneut.","payload":null,"bootloadable":{},"ixData":[]}

用户密码正确,IP地址未从我的服务器列入黑名单。

是的,有人可以帮帮我吗? :)

<?php

/*
#########################################################
#       Copyright to Zatarra @ rstforums.com            #
#        Use it only with your own accounts!            #
#########################################################
*/

//The link variable is the only one you have to modify!!! Leave the rest as it is in order to work.
$link='https://www.facebook.com/LinkToYourComment';

@preg_match_all('/sts\/([0-9]*?)\?comment/',$link,$postid);
if (!@$postid[1][0])
{
@preg_match_all('/fbid=([0-9]*?)\&set/',$link,$postid);
}
@preg_match_all("/comment_id=([0-9]*?)\&offset/",$link,$commentid);
@preg_match_all("/a.([0-9]*?).([0-9]*?).([0-9]*?)\&/",$link,$photo);
if (@$photo[2][0])
{$length=strlen($photo[2][0]);}
else
{$length=5;}

//Initializing cookies folder
$directory=getcwd()."/cookies";

//Checking if cookies folder exists
if (file_exists($directory))
{
//Eating all the cookies to avoid problems
echo shell_exec("rm -rf ./cookies/*.cookie");
}
else
{
//Creating directory
echo shell_exec("mkdir cookies");
}

//Initializing users and passwords
$user=file('users.txt');

function login($username,$password)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://login.facebook.com/login.php?m&next=http://m.facebook.com/home.php");
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_POSTFIELDS, "email=" . @$username . "&pass=" . @$password . "&login=Log In");
curl_setopt($curl, CURLOPT_ENCODING, "");
curl_setopt($curl, CURLOPT_COOKIEJAR, "cookies/$username.cookie");
curl_setopt($curl, CURLOPT_COOKIEFILE, "cookies/$username.cookie");
$curlData = curl_exec($curl);
$curlData = curl_exec($curl);

@preg_match_all('/name=\"fb_dtsg\" value=\"(.*?)\"/',$curlData,$dtsg);
//echo "dtsg => ".$dtsg[1][0]."\n";
@preg_match_all('/\"user\":\"(.*?)\",\"locale\"/',$curlData,$userid);
//echo "Profile Id => ".$userid[1][0]."\n";
@preg_match_all('/data-sigil=(.*?)\>\<table/',$curlData,$rasp);
if (@$rasp[1][0])
{
return array(0,0);
}
else
{
return array($dtsg[1][0],$userid[1][0]);
}
}

function likecomment($username,$password,$fpostid,$fcommentid,$flength)
{
$userdetails=login($username,$password);

if ($userdetails[0]!='0')
{
if ($flength==5)
{
$data='comment_id='.$fpostid.'_'.$fcommentid.'&legacy_id='.$fcommentid.'&like_action=true&ft_ent_identifier='.$fpostid.'&source=2&client_id=1375725162708%3A3550641995&ft[tn]=%3ER0]&__user='.$userdetails[1].'&__a=1&__dyn=7n8ahyj35CFUSt2u5FeDKd8q&__req=q&fb_dtsg='.$userdetails[0].'&ttstamp=26581665371788481';
}
else
{
$data='comment_id='.$fpostid.'_'.$fcommentid.'&legacy_id='.$fcommentid.'&like_action=true&ft_ent_identifier='.$fpostid.'&source=2&client_id=1375725162708%3A3550641995&ft[tn]=%3ER0]&ft[type]=44&nctr[_mod]=photos_snowlift&__user='.$userdetails[1].'&__a=1&__dyn=7n8ahyj35CFUSt2u5FeDKd8q&__req=s&fb_dtsg='.$userdetails[0].'&ttstamp=26581665371788481';
}
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://www.facebook.com/ajax/ufi/comment_like.php");
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_ENCODING, "");
curl_setopt($curl, CURLOPT_COOKIEFILE, "cookies/$username.cookie");
$curlData = curl_exec($curl);
$curlData = curl_exec($curl);
echo $curlData;
}
}

for ($i=0;$i<count($user);$i++)
{
$fb=explode(" ",trim($user[$i]));
likecomment($fb[0],$fb[1],@$postid[1][0],@$commentid[1][0],$length);
likecomment($fb[0],$fb[1],@$postid[1][0],@$commentid[1][0],$length);
}

//Eating all the remain cookies
echo shell_exec("rm -rf cookies/*.cookie");

?>

来源:http://unixcoders.wordpress.com/2013/08/06/facebook-tools-autoliker-account-verifier/

1 个答案:

答案 0 :(得分:0)

非常简单。我将在我的博客上更新来源。

您必须从这一行更改第61行:

@preg_match_all( '/ \ “用户\”:\ “?(*)\”,\ “区域设置\”/',$ curlData,$用户ID);

到这一个:

@preg_match_all( '/ \ “用户\”:\ “?(*)\”,\ “方法\”/',$ curlData,$用户ID);

请检查现在它是否正常工作。这应该! :)