Đã Trao

Facebook curl script explaination with json

i need someone to be able to explain about 5 funcitions in php and curl and also need some additional features added to a facebook curl script that i have

One of the functions i would need to be explained is this

function getFriendLinkForReq(&$curl_handle, $con, $profileid, $post_form_id, $fb_dtsg, $checkReq, $cityList) {

$profileCnt = 1;

$linkCnt = 0;

$url = '[url removed, login to view]'.$profileid.'&__a=1&__d=1';

curl_setopt($curl_handle, CURLOPT_POST, 0);

curl_setopt($curl_handle, CURLOPT_URL, $url);

$page = curl_exec($curl_handle);

$page = str_ireplace('for (;;);', '', $page);

$json_output = json_decode($page);

$tmp1 = '"pb_'.$profileid.'",';

$tmp2 = ', 100, "Profile");';

$tempstr = substr($json_output->onload[6], strpos($json_output->onload[6],$tmp1)+strlen($tmp1), strpos($json_output->onload[6],$tmp2)-strpos($json_output->onload[6],$tmp1)-strlen($tmp1)) ;

$json_output = json_decode($tempstr);

if($json_output[0]->entities) {

foreach($json_output[0]->entities as $e) {

$linkCnt++;

addToReqTable($curl_handle, $con, $e->href.'&v=info', $cityList, $checkReq, $profileCnt);

$profileCnt++;

}

}

$url = '[url removed, login to view]';

if($linkCnt == 0) {

$curPages = 0;

} else {

$curPages = 1;

}

$totalPages = 1;

do{

$qryString = 'class=FriendManager&edge_type=everyone&fb_dtsg='.$fb_dtsg.'&limit=100&post_form_id_source=AsyncRequest&node_id='.$profileid.'&page='.$curPages.'&post_form_id='.$post_form_id;

curl_setopt($curl_handle, CURLOPT_POST, 1);

curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $qryString);

curl_setopt($curl_handle, CURLOPT_URL, $url);

$page = curl_exec($curl_handle);

$page = str_ireplace('for (;;);', '', $page);

$json_output = json_decode($page);

if($json_output->error && $json_output->error == 0) {

break;

}

if(($linkCnt == 0 && $curPages == 0) ||($linkCnt != 0 && $curPages == 1)) {

preg_match('|"count":[0-9]*,|', $page, $match);

$totalPages = str_replace("\"count\":", "", $match[0]);

$totalPages = trim($totalPages, ",");

$totalPages = ceil(((float)$totalPages)/100.0);

echo "totalPages:".$totalPages;

}

if($json_output->payload->user_info) {

foreach($json_output->payload->user_info as $u) {

if($checkReq && $u->action=='add_friend') {

addToReqTable($curl_handle, $con, $u->href.'&v=info', $cityList, $checkReq, $profileCnt);

$profileCnt++;

} else {

addToReqTable($curl_handle, $con, $u->href.'&v=info', $cityList, $checkReq, $profileCnt);

$profileCnt++;

}

}

}

$curPages++;

} while($curPages < $totalPages);

unset($json_output, $page);

}

my budget is 30$ or less

Kĩ năng: PHP, Kiến trúc phần mềm

Xem nhiều hơn: curl json, curl script facebook, facebook curl, facebook json, explaination, curl json facebook, php facebook json, facebook profileid, curl script, www facebook con, www'facebook, match my profile, i need a facebook id, http www facebook com, explain ajax, json curl, payload curl, curl onload, json curl php, php curl json, facebook curl script, facebook php curl json, facebook curl json, script curl facebook, php curl onload

Về Bên Thuê:
( 50 nhận xét ) Dublin, Ireland

ID dự án: #846515

3 freelancer đang chào giá trung bình $110 cho công việc này

SigmaVisual

We can help in your project, please check PMB and our ratings/reviews to get idea of our experience.

$250 USD trong 7 ngày
(220 Nhận xét)
7.7
srinichal

I can explain and do the script additions

$50 USD trong 2 ngày
(90 Nhận xét)
6.9
ghoshkumarsamir

Kindly check your pm.

$30 USD trong 2 ngày
(0 Nhận xét)
0.0