Posted By

NyX on 08/17/09


Tagged

google notify crawl


Versions (?)

Who likes this?

22 people have marked this snippet as a favorite

irishsk
vali29
Vordreller
umang_nine
ignace
silentbob84
tapdrup
nb109
BrianCoyDesign
dimispaceman
adth
Kurt
wirenaught
voove
sbcjr
Envo
telemichus
jsamackay
ApeWare
Some0ne
ringo380
tux-world


Google bot crawl notifier


 / Published in: PHP
 

Include this in any page you want to track for Google bot crawls. Adapt it to your needs (eg: MySQL log instead of e-mail announcement, etc).

  1. <?php
  2.  
  3. $email = "[email protected]";
  4.  
  5. if(eregi("googlebot",$HTTP_USER_AGENT))
  6. {
  7. if ($QUERY_STRING != "")
  8. {
  9. $url = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING;
  10. } else {
  11. $url = "http://".$SERVER_NAME.$PHP_SELF;
  12. }
  13. $date = date("F j, Y, g:i a");
  14. mail($email, "[Googlebot] $url", "$date - Google crawled $url");
  15. }
  16. ?>

Report this snippet  

You need to login to post a comment.