How getting email when Google is indexing my site?

In this example we have taken three spiders: googlebot, msnbot and lycos.
 
For a more complete list of spiders, see Database of Web Robots, Overview.
 
Insert this code on a page and you will get an email when the spider in the ListContainsNoCase is indexing that page. (or pages)

<cfset spider_name = "">

<cfif ListContainsNoCase(#cgi.http_user_agent#,"googlebot")>

<cfset spider_name = "googlebot">

<cfelseif ListContainsNoCase(#cgi.http_user_agent#,"msnbot")>

<cfset spider_name = "msnbot">

<cfelseif ListContainsNoCase(#cgi.http_user_agent#,"lycos")>

<cfset spider_name = "lycos">

</cfif>

<cfif Len(#spider_name#) gt 0>

<cfmail to="yourname@yourserver.com"

from="mailname@domain"

subject="Spider has crawled."

server="mail.domain.com"

type="Plain Text">

#spider_name# has crawled my site.

</cfmail>

</cfif>

 

Advertisement

Radar: Subscribe & Save!

No User Comments.

No User Comments, be the first one to write your comments?

ApplayIT is owned by Scandic Systems LTD [UK] Company No. 5984000. All other trademarks and copyrights are the property of their respective holders.