|
Auto Email on Googlebot Detected Crawling Page Simple script that you can insert in a .php page that will email you when Google is indexing your site. You will need to change the values in the script for your own site and contact details. Simply cut and paste from the following box. Dont forget the opening and closing < ? PHP and ? > tags (without the spaces)
This script is completely free for you to use and modify however you see fit, but if you make any cool changes, please share them with us :)
<?php
if(eregi("googlebot",$HTTP_USER_AGENT))
{
mail("you at youremail.com", "Googlebot detected on yourdomainname.com", "Google has crawled yourdomainname.com");
}
?> Advanced Version: This is a much better version that will automatically fill in the Domain, the actual Page (including any query strings), as well as tell you the Date and Time the page was crawled. Very useful if you want to add this script to many pages. <?php
if(eregi("googlebot",$HTTP_USER_AGENT))
{
if ($QUERY_STRING != "")
{
$url = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING;
} else {
$url = "http://".$SERVER_NAME.$PHP_SELF;
}
$today = date("F j, Y, g:i a");
mail("you at youremail.com", "Googlebot detected on http://$SERVER_NAME", "$today - Google crawled $url");
}
?> |