Get an email when Google visits
- 0
- Add a Comment
Simply stick this piece of code into your website or include file in php and get an email when Google visits that page! Of course, change the [email protected] before you put this into your website.
PHP:
<?php
//Change the following to your email address
$email = “[email protected]”;
if(eregi(“googlebot”,$_SERVER[’HTTP_USER_AGENT’]))
{
mail($email, “Googlebot detected”,
“Google has crawled : “.$_SERVER[’REQUEST_URI’]);
}
?>
Perl:
# give path of sendmail
$mailprog = ‘/usr/sbin/sendmail’;
#Change the following to your email address
$email = [email protected];
$browser = $ENV{’HTTP_USER_AGENT’};
if ($browser =~ m/googlebot/i) {
open (MAIL, “|$mailprog -t”) || die “ERROR: Problem Opening – $mailprog!\n”;
print MAIL “From: $email\n”;
print MAIL “To: $email\n”;
print MAIL “Subject: Googlebot detected\n\n”;
print MAIL “Google has crawled : “.$ENV{’REQUEST_URI’};
close (MAIL);
}
So use at your own risk, and prepare to get spamed.