943,935 Members | Top Members by Rank

Ad:
0

Receive an Email Every time the Googlebot comes to your site!

by on Jan 1st, 2005
Would you like to know when the Google spider or any other spider comes by your site? Well now you can with this handy snippet. It will send you an email for everypage it visits.
ColdFusion Code Snippet (Toggle Plain Text)
  1. <cfif CGI.Http_User_Agent CONTAINS "googlebot">
  2. <cfmail from="info@yoursite.com" to="you@yoursite.com" subject="The Googlebot came to call" server="smtp.mailserver.com">
  3. Google has visited #CGI.Script_Name#
  4. </cfmail>
  5. </cfif>
  6.  
  7. Put this in your application.cfm file in the root of your site. Then every page it visits you get an email, be sure to change the following code to yours;
  8.  
  9. info@yoursite.com = your email
  10. you@yoursite.com = your email
  11. smtp.mailserver.com = your mail server ex. mail.yourdomain.com
  12.  
  13. You can even change the script to alert you to other visits by other spiders, all you need is a list of other bots!
  14.  
  15. Try this list;
  16.  
  17. http://www.robotstxt.org/wc/active/html/
Comments on this Code Snippet
Aug 22nd, 2011
0

Re: Receive an Email Every time the Googlebot comes to your site!

I dont know that i'd put it in the application file. Maybe the index.cfm page, but the application.cfm will be called for every page in that directory and if its in the root of your website, you'll get a TON of emails. That's just my 2 cents though.
Light Poster
jsmall26 is offline Offline
34 posts
since Jan 2008
Message:
Previous Thread in ColdFusion Forum Timeline: Help populating a pdf with coldfusion
Next Thread in ColdFusion Forum Timeline: Moving to next record after 60 seconds





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC