PHP Classes

request :D

Recommend this page to a friend!

      Fast Curl  >  All threads  >  request :D  >  (Un) Subscribe thread alerts  
Subject:request :D
Summary:stack, proxies and delay
Messages:2
Author:mark fdf
Date:2012-01-04 17:23:02
Update:2012-01-04 21:55:23
 

  1. request :D   Reply   Report abuse  
Picture of mark fdf mark fdf - 2012-01-04 17:23:03
hello, I have a couple of request if possible :D

first, lets say you have 100 links in an array is it possible to divide them into stacks so basically the links would be executed in packs of 5,10,15,20,25... also maybe have an array of proxies and for every "stack" a different proxy is used with an option of delay between stacks

Thanks in advance,

Mark

  2. Re: request :D   Reply   Report abuse  
Picture of Antonio López Vivar Antonio López Vivar - 2012-01-04 21:55:23 - In reply to message 1 from mark fdf
Hi! About your request, you can create several FastCurlMulti containers for every pack (use _multiset attribute to set the same proxy for every link in the pack) and then exec them sequentially.

$mh_pack1=new FastCurlMulti($fc_pack1, TRUE); //$fc_pack1 is an array of 5 FastCurl

$mh_pack1->proxy=$your_proxy_array[0];

$mh_pack2=new FastCurlMulti($fc_pack2, TRUE);
$mh_pack2->proxy=$your_proxy_array[1];

$mh_pack3=new FastCurlMulti($fc_pack3, TRUE);
$mh_pack3->proxy=$your_proxy_array[2];

$mh_pack4=new FastCurlMulti($fc_pack4, TRUE);
$mh_pack4->proxy=$your_proxy_array[3];

$mh_pack1->exec();
sleep($delay);

$mh_pack2->exec();
sleep($delay);

$mh_pack3->exec();
sleep($delay);

$mh_pack4->exec();
sleep($delay);

If you don't want to create 100 FastCurl objects, you can use just 5 and recycle them in a loop.

Regards ;)

 
For more information send a message to info at phpclasses dot org.