Tracking Googlebot with ColdFusion

I came across this little script which is a kind of Googlebot alert at It could be worth sticking on a new site to be alerted when Google has arrived.Easy Version
<cfif findNoCase("googlebot", cgi.HTTP_USER_AGENT)>
<cfmail to="" from="" subject="Google has crawled"></cfmail>
Expert Version
<cfif findNoCase("googlebot", cgi.HTTP_USER_AGENT)>
   <cfset today = dateFormat(now(), 'dd/mm/yy')&timeFormat(now(), 'HH:mm:ss')>
   <cfset urlString = "http://"&cgi.SERVER_NAME>
   <cfif len(trim(cgi.QUERY_STRING))>
      <cfset urlString = urlString&"?"&cgi.QUERY_STRING>
   <cfmail to="" from="" subject="Google has crawled">
      Google Detected @ #urlString#
Warning: they are not tested yet so use at own risk.Obviously this has a few other uses, it could even be modified to see when the MSN bot or all of them coming across.
comments powered by Disqus