Introduction
It was always a question to me that how to be notified when a search engine robot like google's reaches to a website. On the other hand I was wondering about receiving a notification as soon as google explores my website.
I spent sometime on google and searched the internet to see if I can find a trick or technique to employ it to receive a notification once my website is hit by google itself. The question is not why it is important to know when the website is crawled by google, but the question is how to achieve this goal?!
Code Snippet
First of all, please don't expect that this article should describe an algorithm or a lengthy sample code. This is only a small but useful technique. I ran into the following PHP code snippet in PHP on a weblog somewhere on internet :
if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Googlebot' ) !== false )
{
In the body of above 'if' statement an email is sent to
MyName@MyDomain.com once the website is hit by google. Even we can send a notification to cell phones too if google reaches to a website. All we need is to substitute the code inside the 'if' block with a certain of instructions to trigger a SMS to a cell phone via web as
it is described in this weblog.