Function cURL:
function cURL($nodes)
{
$success = 0;
$node_count = count($nodes);
$curl_arr = array();
$master = curl_multi_init();
for($i = 0; $i < $node_count; $i++) { $url =$nodes[$i]; $curl_arr[$i] = curl_init($url); curl_setopt($curl_arr[$i], CURLOPT_RETURNTRANSFER, true); curl_setopt($curl_arr[$i], CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($curl_arr[$i], CURLOPT_TIMEOUT, 15); curl_multi_add_handle($master, $curl_arr[$i]); } do{ curl_multi_exec($master,$running); } while($running > 0);
for($i = 0; $i < $node_count; $i++) { $results = curl_multi_getcontent($curl_arr[$i]); curl_multi_remove_handle($master, $curl_arr[$i]); curl_close($curl_arr[$i]); } curl_multi_close($master); return $success; }
Cách dùng :
$url = array('https://graph.facebook.com/...','https://graph.facebook.com/...','https://graph.facebook.com/...',...);Theo kết quả của coder : Cái này là curl multiple thread.Muốn biết rõ hơn về nó thì các bạn có thể lên google xem.Cái này test thấy 1 click đc 500 like(Chưa tới 30s). Tuy nhiên,mình không khuyến khích dùng nó
cURL($url);
Nguồn : V4U.VN






Copyright © 2018
sao ko khuyến khích dùng =))
Trả lờiXóaTại vì Facebook sẽ chặn request từ 1 IP đến graph, nên bạn có thể thấy add một số access token vào chạy like thì tầm 20 30p sau die hết :D
Xóa