User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 331,470 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,031 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser:
Jan 1st, 2005
Views: 3,329
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 Syntax | 5 stars
  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/
Post Comment

Only community members can submit or comment on code snippets. You must register or log in to contribute.

DaniWeb Marketplace (Sponsored Links)
All times are GMT -4. The time now is 8:30 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC