| px | top | add code | search | signup | login | help |
<?php
/**
* e-cbd.biz Search Engine Tool
* version 1.0
* Copyright (C) 2006 Peter Soper http://www.e-cbd.biz/
* PHP script to log search engines spider visits.
* FREE TO USE BUT DO NOT REMOVE COPYRIGHT NOTICES OR CHANGE ANYTHING
* EMAIL admin@e-cbd.biz for customisation or any info
*/
/**
* for emal reports place your email betweem the red commas (optional)
*/
$email = "";
/**
* Location of the log file (optional)
*/
$log = "./bots.log";
/**
* Date/Time format
*/
$dateTime = date("r");
// DO NOT MODIFY BELOW THIS //////////////////////////////////////////
$agents[] = 'scooter';
$spiders[] = "Scooter (Altavista's robot www.altavista.com)";
$agents[] = 'googlebot';
$spiders[] = 'Google';
$agents[] = 'slurp';
$spiders[] = "Slurp (Inktomi's robot, HotBot)";
$agents[] = 'webmoose';
$spiders[] = "Webmoose (MSN.com's robot, www.msn.com)";
$agents[] = 'gulliver';
$spiders[] = "Gulliver (Northern Light's robot, www.northernlight.com)";
$agents[] = 'lycos';
$spiders[] = 'Lycos www.lycos.com';
$agents[] = 'wombat';
$spiders[] = "WebWombat's robot, www.webwombat.com.au";
$agents[] = 'infoseek';
$spiders[] = 'Infoseek www.infoseek.com';
$agents[] = 'askjeeves';
$spiders[] = 'Askjeeves www.askjeeves.com';
$agents[] = 'freecrawl';
$spiders[] = "Free Crawl (Euroseek's robot, www.euroseek.com)";
$agents[] = 'robozilla';
$spiders[] = "Robozilla (DMOZ's Directory link checker robot, www.dmoz.com)";
$agents[] = 'zyborg';
$spiders[] = "ZyBorg (WiseNut's robot, www.wisenutbot.com)";
$agents[] = 'Gigabot';
$spiders[] = 'Gigabot, www.gigablast.com';
$agents[] = 'Ask Jeeves/Teoma';
$spiders[] = 'Ask Jeeves/Teoma, www.teoma.com, www.askjeeves.com';
$agents[] = 'grub-client';
$spiders[] = 'Grub (Looksmart Grub client robot, www.grub.org)';
$agents[] = 'linkwalker';
$spiders[] = 'Linkwalker (SevenTwentyFour link checker robot, www.seventwentyfour.com)';
$agents[] = 'ia_archiver';
$spiders[] = "Internet Archive (Alexa & WayBackMachine's robot, www.archive.org, www.alexa.com)";
$agents[] = 'TurnitinBot';
$spiders[] = 'TurnitinBot (Anti-Plagiarism robot, www.turnitin.com)';
$agents[] = 'atSpider';
$spiders[] = 'atSpider (Email Collector/Spam)';
$agents[] = 'autoemailspider';
$spiders[] = 'autoemailspider (Email Collector/Spam)';
$agents[] = 'cherrypicker';
$spiders[] = 'cherrypicker (Email Collector/Spam)';
$agents[] = 'DSurf';
$spiders[] = 'DSurf (Email Collector/Spam)';
$agents[] = 'DTS Agent';
$spiders[] = 'DTS Agent (Email Collector/Spam)';
$agents[] = 'EliteSys Entry';
$spiders[] = 'EliteSys Entry (Email Collector/Spam)';
$agents[] = 'EmailCollector';
$spiders[] = 'EmailCollector (Email Collector/Spam)';
$agents[] = 'EmailSiphon';
$spiders[] = 'EmailSiphon (Email Collector/Spam)';
$agents[] = 'EmailWolf';
$spiders[] = 'EmailWolf (Email Collector/Spam)';
$agents[] = 'Mail Sweeper';
$spiders[] = 'Mail Sweeper (Email Collector/Spam)';
$agents[] = 'msnbot';
$spiders[] = 'MSN Robot (MSN Search, search.msn.com)';
$agents[] = 'whatuseek';
$spiders[] = 'What You Seek';
$agents[] = 'yahoo\! slurp';
$spiders[] = 'Yahoo! Slurp';
$found = false;
for ($spi = 0; $spi < count($spiders); $spi++)
if ($found = eregi($agents[$spi], $_SERVER['HTTP_USER_AGENT']))
break;
if ($found) {
$url = "http://" . $_SERVER['SERVER_NAME']. $_SERVER['PHP_SELF'];
if ($_SERVER['QUERY_STRING'] != "") {
$url .= '?' . $_SERVER['QUERY_STRING'];
}
$line = $dateTime . " " . $spiders[$spi]. " @ " . $url;
if ($log != "") {
if (@file_exists($log)) {
$mode = "a";
} else {
$mode = "w";
}
if ($f = @fopen($log, $mode)) {
@fwrite($f, $line . "\n");
@fclose($f);
}
}
if ($email != "") {
$headers = "From: <$email>\n";
$headers .= "X-Sender: <$email>\n";
$headers .= "X-Mailer: Search Engine Bot detector\n";
$headers .= "X-Priority: 3\n";
$subject = $spiders[$spi]. " crawled your site";
@mail($email, stripslashes($subject), wordwrap(stripslashes($line)), $headers);
}
}
if ($_REQUEST["js"]) {
header("Content-Type: image/gif\r\n");
header("Cache-Control: no-cache, must-revalidate\r\n");
header("Pragma: no-cache\r\n");
@readfile("bots.gif");
}
?>
Comments or questions?
PX is running PHP 5.2.11
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.