Voila...
Normalement tu rajoutes juste un petit fichier 'stock.txt' dans lequel tu colles tes mots clés
<?php
error_reporting(E_ALL ^ E_NOTICE);
?>
<TITLE>000</TITLE>
<?php
//OUVERTURE DU COMPTEUR
$compteur = 1;
// PAS PLUS SINON GOOGLE EJECTE L'ADRESE IP
while ($compteur < "7" )
{
$compteur++;
$i = 2;
//OUVERTURE DU STOCKAGE DES MOTS CLES
$fichier = fopen("stock.txt",'r');
while ($i < $compteur)
{
$i++;
//RECUPERATION DE LA VARIABLE ET RETRAIT DERNIER CHR QUI CAUSE BUG
$mc = fgets($fichier, 1024);
$motcle = $mc;
if ( (substr($mc,0,1) === "é" ) || (substr($mc,0,1) === "è" ) || (substr($mc,0,1) === "ê" ) )
{
$motcleinserer = $mc;
$mc = "e".substr($mc,1);
}
if ( (ord(substr($mc, -1)) < 48) || (ord(substr($mc, -1)) > 122) )
{
echo '__'.$mc.'__<br>';
$mc = substr($mc, 0, -1);
$motcle = $mc;
$motcleinserer = $mc;
}
if ( (ord(substr($mc, -1)) < 48) || (ord(substr($mc, -1)) > 122) )
{
echo '__'.$mc.'__<br>';
$mc = substr($mc, 0, -1);
$motcle = $mc;
$motcleinserer = $mc;
echo '__'.$mc.'__<br>';
}
$motcleinserer = str_replace(" ","+",$motcle);
$url_temp = "http://www.google.fr/search?q=".$motcleinserer."&sa=N&num=100&start=000";
$url = $url_temp;
}
fclose($fichier);
//FERMETURE DU STOCKAGE DES URL
echo 'URL EN COURS DE LECTURE : '.$url.'<br>';
//////////////////////////////////
//////////////////////////////////
// DEBUT ROUTINE DE RECHERCHE //
//////////////////////////////////
//////////////////////////////////
if (isset($url))
{
$lines = file($url);
foreach ($lines as $line_num => $line)
{
$htmline = htmlentities($line);
if (strpos($htmline,'a href') !== FALSE)
{
//DECOMPOSITION DU CODE PRINCIPAL
$htmline = str_replace("a href", "_A HREF_", $htmline);
$htmline = str_replace(""", "_QUOTE_", $htmline);
$htmline = str_replace(">", "_GTCRC_", $htmline);
$htmline = str_replace("<", "_LTCRC_", $htmline);
$htmline = str_replace("&", "_ET_", $htmline);
$htmline = str_replace("ET_amp;", "&", $htmline);
$htmline = str_replace("A HREF_=_QUOTE_", "_DEBUT_LIEN_", $htmline);
$htmline = str_replace("_ET_", "&", $htmline);
$htmline = str_replace("_LTCRC_span class=tbpo_GTCRC_Masquer les options_LTCRC_/span","", $htmline);
$tempo = explode('_DEBUT_LIEN_', $htmline);
//EXPLORATION AU NIVEAU D'UNE GROSSE LIGNE
$i= 0;
while ($i < "400" )
{
$i++;
// AFFICHAGE DE LA LIGNE
$lienhtml = @explode("_QUOTE_",$tempo[$i]);
//SI ON A GOOGLE DANS LE LIEN ON N'ENREGISTRE PAS
if ( (stristr($lienhtml[0],'google') === FALSE)
&& (stristr($lienhtml[0],'q=http') === FALSE)
&& (stristr($lienhtml[0],'search?q') === FALSE)
&& (stristr($lienhtml[0],'url?q=') === FALSE)
&& (strpos($lienhtml[0],'youtube') === FALSE)
&& (strpos($lienhtml[0],'search?hl') === FALSE)
&& (stristr($lienhtml[0],'maps.google') === FALSE)
&& (stristr($lienhtml[0],'q=cache') === FALSE)
&& (stristr($lienhtml[0],'img src') === FALSE)
&& (stristr($lienhtml[0],'search?num') === FALSE)
&& (substr($lienhtml[0],0,4) ==="http" ))
{
$titre = explode("class=l_GTCRC_",$tempo[$i]);
$titre = str_replace("_LTCRC_em_GTCRC_","",$tempo[$i]);
$titre = str_replace($lienhtml[0],"",$titre);
$titre = str_replace("_LTCRC_/em_GTCRC_","",$titre);
$titre = str_replace("_LTCRC_br_GTCRC_","",$titre);
$titre = str_replace("_LTCRC_cite_GTCRC_","",$titre);
$titre = str_replace("_LTCRC_/cite_GTCRC_","",$titre);
$titre = str_replace("_LTCRC_b_GTCRC_","",$titre);
$titre = str_replace("_LTCRC_/b_GTCRC_","",$titre);
$titre = str_replace("_LTCRC_","",$titre);
$titre = str_replace("span class=gl","",$titre);
$titre = str_replace("/a_GTCRC_/h3_GTCRC_div class=_QUOTE_s hc_QUOTE_","",$titre);
$titre = str_replace("valign=top id=mbb4","",$titre);
$titre = str_replace("_QUOTE_ class=l title=_QUOTE_","",$titre);
$titre = str_replace("_QUOTE_ class=l_GTCRC_","",$titre);
$titre = str_replace("|","-",$titre);
$titre = str_replace("ä","ä",$titre);
$titre = str_replace("ë","ë",$titre);
$titre = str_replace("ï","ï",$titre);
$titre = str_replace("ö","ö",$titre);
$titre = str_replace("ü","ü",$titre);
$titre = str_replace("â","â",$titre);
$titre = str_replace("ê","ê",$titre);
$titre = str_replace("î","î",$titre);
$titre = str_replace("ô","ô",$titre);
$titre = str_replace("û","û",$titre);
$titre = str_replace("à","à",$titre);
$titre = str_replace("À","A",$titre);
$titre = str_replace("è","è",$titre);
$titre = str_replace("È","E",$titre);
$titre = str_replace("ù","ù",$titre);
$titre = str_replace("é","é",$titre);
$titre = str_replace("É","E",$titre);
$titre = str_replace("ç","ç",$titre);
$titre = str_replace(""",'\"',$titre);
$titre = str_replace("®","®",$titre);
$titre = str_replace("»",'\"',$titre);
$titre = str_replace("'","\'",$titre);
$titre = str_replace(">",">",$titre);
$titre = str_replace("<","<",$titre);
$positionfintitre = strpos($titre,"/a" );
if ($positionfintitre>0)
{
$titre = substr($titre,0,$positionfintitre);
}
////////////////////////////
/// INSERTION TITRE DANS ///
/// BASE_GLOBALE ///
////////////////////////////
if (isset($titre))
{
$tempotitre = explode(' ',$titre);
if (isset($tempotitre[0]))
{
$t = 0;
while ($t < 15)
{
$t++;
if (stristr($tempotitre[$t],"/a" ) !== FALSE)
{
$lastword = $t;
$tempotitre[$t] = substr($tempotitre[$t],0,strpos($tempotitre[$t],"/a" ));
}
}
}
}
$t=-1;
if (!isset($lastword))
{
$lastword = 10;
}
while ($t < $lastword +1)
{
$t++;
if ( (strlen($tempotitre[$t]) > 3) && (stristr($tempotitre[$t],'_') === FALSE) )
{
//CHOIX NOM DE LA BASE EN FONCTION DE LA PREMIERE LETTRE DU MOT
$tempotitre[$t] = strtolower($tempotitre[$t]);
$tempotitre[$t] = str_replace("l\'","",$tempotitre[$t]);
$tempotitre[$t] = str_replace("d\'","",$tempotitre[$t]);
$tempotitre[$t] = str_replace("n\'","",$tempotitre[$t]);
$tempotitre[$t] = str_replace("m\'","",$tempotitre[$t]);
$tempotitre[$t] = str_replace("j\'","",$tempotitre[$t]);
$tempotitre[$t] = str_replace("[","",$tempotitre[$t]);
$tempotitre[$t] = str_replace("]","",$tempotitre[$t]);
$tempotitre[$t] = str_replace("(","",$tempotitre[$t]);
$tempotitre[$t] = str_replace(" )","",$tempotitre[$t]);
$tempotitre[$t] = str_replace(",","",$tempotitre[$t]);
$tempotitre[$t] = str_replace(":","",$tempotitre[$t]);
$tempotitre[$t] = str_replace("·","-",$tempotitre[$t]);
$tempotitre[$t] = str_replace("«","",$tempotitre[$t]);
$tempotitre[$t] = str_replace("¤","€",$tempotitre[$t]);
$tempotitre[$t] = str_replace('\"',"",$tempotitre[$t]);
$tempotitre[$t] = str_replace(">","-",$tempotitre[$t]);
$tempotitre[$t] = str_replace("âble","â",$tempotitre[$t]);
$tempotitre[$t] = str_replace("ô","ô",$tempotitre[$t]);
$tempotitre[$t] = str_replace("...","",$tempotitre[$t]);
$tempotitre[$t] = str_replace("ç","ç",$tempotitre[$t]);
$tempotitre[$t] = str_replace("°","°",$tempotitre[$t]);
$temp = substr($tempotitre[$t],0,1);
/////////////////////////////////
/// MISE A JOUR FICHIER TEXTE ///
/////////////////////////////////
$mafichebase = 'DICO/'.$tempotitre[$t].'_BASE.csv';
$fichier_base = fopen($mafichebase,'a');
fwrite($fichier_base, $lienhtml[0]);
fwrite($fichier_base, "|" );
fwrite($fichier_base, $titre);
fwrite($fichier_base, "\r\n" );
fclose($fichier_base);
}
}
////////////////////////////
$positionfintitre =0;
$positionfintitre = strpos($titre,"/a" );
if ($positionfintitre>0)
{
$titre = substr($titre,0,$positionfintitre);
}
$positionfintitre2 =0;
$positionfintitre2 = strpos($titre,"_QUOTE_" );
if ($positionfintitre2>0)
{
$titre = substr($titre,0,$positionfintitre2);
}
echo '<font size ="2" color ="blue">===>Adresse===>'.$lienhtml[0].'<br></font>';
echo '<font size ="2" color ="red">===>Titre===>'.$titre.'<br></font>';
// //CONNEXION A LA BASE DE DONNEES
// $db="base__";
// $link = mysql_pconnect("localhost", "pulbot","abcdefgh" );
// mysql_select_db($db , $link);
// $commande = " INSERT INTO `$tempotitre[$t]` (`url`, `titre`) VALUES ('$lienhtml[0]','$titre')";
// $sql = mysql_query($commande);
// $sql = mysql_query(" DELETE FROM `$tempotitre[$t]` WHERE `url` NOT LIKE 'http://%'" );
}
}
}
}
}
}
?>
---------------
http://www.ypikay.com