Forum Moderators: open

Message Too Old, No Replies

Googlebot notification tip (php)

         

kgormat

3:52 am on Nov 9, 2002 (gmt 0)

10+ Year Member



I stumbled across this snipet of php code today and thought many of you could put it to good use. To summarize, it will immediately alert you to the arrival of Googlebot via email. This is assuming of course you have sendmail, qmail, etc. configured.

if(eregi("google",$HTTP_USER_AGENT))
{
mail("user@yourdomain", "Googlebot detected", "Google has crawled yourdomain.com");
}

bcc1234

4:04 am on Nov 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to keep state somehow.
Otherwise, you'll end up with thousands of emails for each googlebot hit.
Unless you only put it in the index page or in robots.txt and make it get processed by the php engine.

I think we talked about a few days ago.

jomaxx

4:19 am on Nov 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Even my robots.txt gets spidered many times a day, every day, by Googlebot. Email notification would get tiresome really fast.