Thread: Multi Curl Class
jsp123

I have outgrown single curl and would like to know if anyone know how to use this multicurl class... http://webuildspam.com/code/class.Curl.

php

 s.  Some docs for it can be found here http://www.

blackhat

 -

seo

 .com/2007/curl-multi-class-

php

 5/ .

Here is one of my attempts:

Code:

<?

php

 
include_once "curl.

php

 ";

$c = new Curl;

function printbody($data) {
echo $data['body'];
}

$urls = array('http://www.google.com/','http://www.yahoo.com/');
$t = $c->make($urls,'','printbody');
$c->perform($t);

?>


Anyways if anyone has a small working example to get me running it would be very much appreciated, or even a point in the right direction.

Thanks!

Jsp

esrun

Whipped something up for you quickly: http://www.esrun.co.uk/blog/curl-multi-socket-example/

jsp123

Hey thanks esrun, just found your gmail account maker today also.  Cant wait to try them both out...

Thanks Alot!

jsp123

Update: Got my scraper reworked with multi, much easier than i thought. Woohoo Applause

Plepco

I've been struggling with multi-cURL myself, so it was nice to find this. You know, there are very few good examples or even any documentation about multi-cURL out there.

Thanks

meme

Simple problem, make() doesnt take an array of urls. Check http://www.

blackhat

 -

seo

 .com/2007/curl-multi-examples/ for examples.


Perkiset's Place Home   Politics @ Perkiset's