Return to Snippet

Revision: 16822
at August 17, 2009 11:25 by NyX


Initial Code
<?php

$email = "[email protected]";

if(eregi("googlebot",$HTTP_USER_AGENT))
{
    if ($QUERY_STRING != "")
    {
        $url = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING;
    } else {
        $url = "http://".$SERVER_NAME.$PHP_SELF;
    }
    $date = date("F j, Y, g:i a");
    mail($email, "[Googlebot] $url", "$date - Google crawled $url");
} 
?>

Initial URL

                                

Initial Description
Include this in any page you want to track for Google bot crawls.
Adapt it to your needs (eg: MySQL log instead of e-mail announcement, etc).

Initial Title
Google bot crawl notifier

Initial Tags
google

Initial Language
PHP