";
echo " GET: http://m.facebook.com/findfriends.php ";
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, '3');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'fb_cookies.txt');
curl_setopt($ch, CURLOPT_URL, 'http://m.facebook.com/findfriends.php');
$content = curl_exec($ch);
return $content;
}
}
function invite_friend($login_email,$login_pass,$f_id,$token)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://login.facebook.com/login.php?login_attempt=1');
curl_setopt($ch, CURLOPT_POSTFIELDS,'charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&locale=en_US&email='.urlencode($login_email).'&pass='.urlencode($login_pass).'&pass_placeholder=&charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_COOKIEJAR, str_replace('\\','/',dirname(__FILE__)).'/fb_cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, str_replace('\\','/',dirname(__FILE__)).'/fb_cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3");
curl_exec($ch);
$err = 0;
$err = curl_errno($ch);
if ($err != 0){
curl_close($ch);
echo 'LOGIN: error='.$err."\n";
return(false);
}
else
{
$infos = curl_getinfo($ch);
$_ID = iconv('ISO-8859-1','UTF-8',urlencode($f_id));
$_PL = iconv('ISO-8859-1','UTF-8',urlencode('/find-friends/index.php'));
$_TOKEN = iconv('ISO-8859-1','UTF-8',urlencode($token));
$_SURI = iconv('ISO-8859-1','UTF-8',urlencode('/findfriends.php?fr_id='.$_ID));
$_REFID = iconv('ISO-8859-1','UTF-8',urlencode('43'));
$_HF = iconv('ISO-8859-1','UTF-8',urlencode('friend_browser'));
echo "LOGIN: SUCESS
SEND REQUEST:
ID : ".$_ID."
TOKEN: ".$_TOKEN."
SURI : ".$_SURI."
PL : ".$_PL."
REFID: ".$_REFID."
HF : ".$_HF."
";
echo 'URL: http://m.facebook.com/a/mobile/friends/add_friend.php?id='.$_ID.'&hf='.$_HF.'&pl='.$_PL.'&suri='.$_SURI.'&gfid='.$_TOKEN.'&refid='.$_REFID.'
';
curl_setopt($ch, CURLOPT_URL,'http://m.facebook.com/a/mobile/friends/add_friend.php?id='.$_ID.'&hf='.$_HF.'&pl='.$_PL.'&suri='.$_SURI.'&gfid='.$_TOKEN.'&refid='.$_REFID.'');
curl_setopt($ch,CURLOPT_BINARYTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: m.facebook.com',
'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language: hu-hu,hu;q=0.8,en-us;q=0.5,en;q=0.3',
'Accept-Charset: utf-8;q=0.7,*;q=0.7',
'Connection: keep-alive',
'Accept-Language: hu-hu,hu;q=0.8,en-us;q=0.5,en;q=0.3',
'Referer: https://m.facebook.com/findfriends.php'
));
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_COOKIEFILE, 'fb_cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3");
$err = 0;
$err = curl_errno($ch);
if ($err != 0){
curl_close($ch);
echo 'LOGIN: error='.$err."\n";
}
else {
$c = curl_exec($ch);
$string = "You sent a friend request to ";
if(stristr(strip_tags($c), $string) === FALSE) {
echo("ERROR: Can't sent a friend request");
$fail--;
}
else
echo "You sent a friend request to ".$_ID."";
curl_close($ch);
}
}
}
echo "