[php]php
set_time_limit(0);
function post_data($site,$data,$ref,$ajax){$datapost = curl_init();
if($ajax == true){$headers = array("X-Requested-With: XMLHttpRequest");
}else{$headers = array('Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8','Accept-Language: vi-VN,vi;q=0.9','Content-Type: application/x-www-form-urlencoded
');
}curl_setopt($datapost, CURLOPT_URL, $site);curl_setopt($datapost, CURLOPT_TIMEOUT, 40000);curl_setopt($datapost, CURLOPT_HEADER, TRUE);curl_setopt($datapost, CURLOPT_HTTPHEADER, $headers);curl_setopt($datapost, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36');curl_setopt($datapost, CURLOPT_FOLLOWLOCATION, TRUE);curl_setopt($datapost, CURLOPT_SSL_VERIFYPEER, TRUE);curl_setopt($datapost, CURLOPT_REFERER, $ref);curl_setopt($datapost, CURLOPT_COOKIEJAR, __DIR__ .'/cookie.txt');curl_setopt($datapost, CURLOPT_COOKIEFILE, __DIR__ .'/cookie.txt');
if($data){curl_setopt($datapost, CURLOPT_POST, TRUE);curl_setopt($datapost, CURLOPT_POSTFIELDS, $data);
}curl_setopt($datapost, CURLOPT_RETURNTRANSFER, true);
return curl_exec ($datapost);
}
$token = 'EAACW5Fg5N2IBAE0wFfUY9LeIfrKaj9bxrobtuS4c6D9JN1Ulv2QZCODND23ixrZCfRM77PA0hZBTHAt31x6ZCn9cx9l1lBHIdas87O9Tr3x2vd6mpG8ZBHhO4PrBHDCgH1CL0MxQmS6ZAuTdtvn1AtBSBTm5zQZBlzrXetN8fbl41ZAnYSspg6DZAfLEg3xm3ACAZD'; // thay token vào Đây$idfb = '100010789870424'; // id FB bỏ vô đây$graph = json_decode(file_get_contents('https://graph.facebook.com/'.$idfb.'/feed?fields=id&access_token='.$token), true);$id_stt = explode('_',$graph['data'][0]['id']);$id = $id_stt[1];
if(isset($id)){
// web 1
$get = post_data('https://begen.co/','','https://begen.co/',false);
preg_match('/name="csrf" value="(.*?)"/',$get,$vg);
$csrf = $vg[1];
echo post_data('https://begen.co/kontrol.php','token='.$token.'&terms=on&csrf='.$csrf,'https://begen.co/',false);
echo post_data('https://begen.co/l/basla.php','bgid='.$id.'&gg='.$idfb.'&lmt=35','https://begen.co/',true);
}else{
echo 'Token Die rồi thì phải Không lấy được IDSTT';
}?>?>
Nguồn: https://v4u.vn/threads/share-code-curl-notime-2018_123664.html#ixzz5KKxZPGQD
Bài đăng