1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
|
<?
if(isset($_POST['site'])){
if($_POST['site'] != ""){
$site = $_POST['site'];
if(!isset($_SESSION['firstsite'])){
$_SESSION['firstsite'] = $site;
}
}else{
header("Location: index.php");
}
}elseif(isset($_GET['site']) && $_GET['site'] != ""){
$site = $_GET['site'];
}else{
include('connect.php');
$alea = rand(1, 12);
$requete = mysql_query("SELECT * FROM liens_secour");
$i=1;
while($donnes = mysql_fetch_array($requete)){
$tabsite[$i] = $donnes['lien'];
$i++;
}
$newsite = $tabsite[$alea];
echo "<script language=\"JavaScript\">
setTimeout(\"window.location='adibot.php?site=$newsite'\",3000);
</script>";
}
$code = file_get_contents($site);
if(preg_match("<html>", $code)){
echo "<font color='#0000FF'>Indexation en cours ($site)</font>";
preg_match('!<title>(.+)</title>!isU', $code, $title);
$titre = $title[1];
preg_match('!<meta name="description" content="(.+)"(.+)>!isU', $code, $description);
$desc = $description[1];
$desc = str_replace("û", "û", $desc);
preg_match('!<meta name="keywords" content="(.+)"(.+)>!isU', $code, $clee);
$keywords = $clee[1];
preg_match_all('!<a href="(.+)"(.+)!isU', $code, $lien);
$nb=count($lien[1]);
if($titre != '' && $desc != '' && $keywords != '' && $nb > 0){
$i = 0;
foreach($lien[1] as $key => $value){
if(substr($lien[1][$key], 0, 7) == 'http://'){
$_SESSION['bonsliens'][$i] = $lien[1][$key];
$i++;
}
}
$nbbonsliens = count($_SESSION['bonsliens']);
$date=date('d/m/y H\hi');
include('connect.php');
$requete = mysql_query("SELECT * FROM bot_sites WHERE adresse_site='$site'");
$reponse = mysql_num_rows($requete);
if($reponse == '0')
{
mysql_query("INSERT INTO bot_sites VALUES ('', '$titre', '$desc', '$site', '$keywords', '$date', '1')");
$alea = rand(0, $nbbonsliens);
$newsite = $_SESSION['bonsliens'][$alea];
echo "<script language=\"JavaScript\">
setTimeout(\"window.location='adibot.php?site=$newsite'\",3000);
</script>";
}
else
{
echo "<font color='#CC0000'>Site déjà visité !</font>";
$alea = rand(0, $nbbonsliens);
$newsite = $_SESSION['bonsliens'][$alea];
echo "<script language=\"JavaScript\">
setTimeout(\"window.location='adibot.php?site=$newsite'\",3000);
</script>";
}
}else{
if(isset($_SESSION['bonsliens'])){
$nbbonsliens = count($_SESSION['bonsliens']);
$alea = rand(0, $nbbonsliens);
$newsite = $_SESSION['bonsliens'][$alea];
echo "<script language=\"JavaScript\">
setTimeout(\"window.location='adibot.php?site=$newsite'\",3000);
</script>";
}else{
include('connect.php');
$alea = rand(1, 12);
$requete = mysql_query("SELECT * FROM liens_secour");
$i=1;
while($donnes = mysql_fetch_array($requete)){
$tabsite[$i] = $donnes['lien'];
$i++;
}
$newsite = $tabsite[$alea];
echo "<script language=\"JavaScript\">
setTimeout(\"window.location='adibot.php?site=$newsite'\",3000);
</script>";
}
}
}else{
echo "<font color='red'>Erreur, page non html !</font><br/>";
echo "<a href='index.php'>Retour à l'index</a>";
if(isset($_SESSION['bonsliens'])){
$nbbonsliens = count($_SESSION['bonsliens']);
$alea = rand(0, $nbbonsliens);
$newsite = $_SESSION['bonsliens'][$alea];
echo "<script language=\"JavaScript\">
setTimeout(\"window.location='adibot.php?site=$newsite'\",3000);
</script>";
}else{
include('connect.php');
$alea = rand(1, 12);
$requete = mysql_query("SELECT * FROM liens_secour");
$i=1;
while($donnes = mysql_fetch_array($requete)){
$tabsite[$i] = $donnes['lien'];
$i++;
}
$newsite = $tabsite[$alea];
echo "<script language=\"JavaScript\">
setTimeout(\"window.location='adibot.php?site=$newsite'\",3000);
</script>";
}
}
?> |
Partager