Arquivo 1(index.php):
".$procura."
";
$pageNeed=1;
for($n=0;$n<$pageNeed;$n++)
{
echo "Página---".($n+1)."
";
$spider=new googleCrawler($procura,$n);
$spider->getGoogleDivs();
$links=$spider->getGoogleLinks();
$titles=$spider->getGoogleTitles();
$descriptions=$spider->getGoogleDescriptions();
for($i=1;$i<(count($links))+1;$i++)
{
echo "
";
}
}
?>
Arquivo 2(classe.php):
0)
$keywords=str_replace(' ','+',$keywordsGot);
else
$keywords=$keywordsGot;
if($pageNum==0)
$this->content=file_get_contents("http://www.google.com/search?q=".$keywords);
else
{
$index=($pageNum*10);
$this->content=file_get_contents("http://www.google.com/search?q=".$keywords."&start=".$index);
}
}
function getGoogleDivs()
{
$j = 0;
for ($i=0;$i<=strlen($this->content);$i++)
{
if (substr($this->content,$i,strlen('')+1;
$k=$i;
while (substr($this->content,$k,strlen('
'))!='')
{
$k++;
}
$en=$k+strlen('');
$this->divs[$j]=substr($this->content,$st,$en-$st);
}
}
}
function getGoogleLinks()
{
for($n=1;$ndivs)+1;$n++)
{
for ($i=0;$i<=strlen($this->divs[$n]);$i++)
{
if (substr($this->divs[$n],$i,strlen('