|
Posted by vito on 05/04/06 13:51
a week ago 2 kind persons suggested me to use fread to read a result page.
i've been working for it but just can't get what i want.
$keyword ="big problem";
$startfig = rand(0,60);
//$theFile
="http://images.google.com/images?q=\"".$keyword."\"&start=".$startfig;
//$theFile
="http://images.google.com/images?q=\"".$keyword."\"&start=".strval($startfig);
$theFile ="http://images.google.com/images?q=acd";
if (($f = fopen($theFile, 'r')) === false) exit;
$contents = fread($f, (9*(1024*1024)));
echo "$contents";
fclose ($f);
$matchno = preg_match_all("/.*<img src=/images?q=tbn:.*:(.*)
width=.*>.*/", $contents, $regs);
$imgurl = $regs[rand(0,$matchno-1)];
why can't i retrieve the result obtained from google image search?
Navigation:
[Reply to this message]
|