Found This Script Today

liunx

Guest
Simple script that you can insert in a .php page that will email you when Google is indexing your site. You will need to change the values in the script for your own site and contact details.<br /><br /><b>Simple version</b><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?<br />if(eregi("googlebot",$HTTP_USER_AGENT))<br /> {<br /> mail("[email protected]", "Googlebot detected on yourdomainname.com", "Google has crawled yourdomainname.com");<br /> }<br />?><!--c2--></div><!--ec2--><br /><br /><br /><br /><b>Advanced version</b><br />This is a much better version that will automatically fill in the Domain, the actual Page (including any query strings), as well as tell you the Date and Time the page was crawled.<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?<br />if(eregi("googlebot",$HTTP_USER_AGENT))<br />    {<br />    if ($QUERY_STRING != "")<br />  {$url = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING;}<br />    else<br />  {$url = "http://".$SERVER_NAME.$PHP_SELF;}<br />    $today = date("F j, Y, g:i a");<br />    mail("[email protected]", "Googlebot detected on http://$SERVER_NAME", "$today - Google crawled $url");<br />    }<br />?><!--c2--></div><!--ec2--><!--content-->
Nice!<br />I have added it to my home page.<br />Thanks leezard Thumbs Up<!--content-->
What if I wanted to keep track of more than one bot?<!--content-->
I use this script myself. One time, I decided to include it in every page and I got bombarded by hundreds of emails.<br /><br />One idea would be to put it on your site map, home, and maybe one or two other pages that you want to track. (New page, for example.)<br /><br />Adding extra bots wouldn't be hard. Maybe Dsdemmin and myself could work on such a script for TCH members. We'll see.<!--content-->
I put the script on my index page and changed it to index.php. I put a redirect in the .htaccess file to reflect the change from index.html to index.php. Then I clicked on the link for my Family Tree and got my main index.php page <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> So I ended up taking out the redirect then I could click on the link and be taken to my Family Tree site... <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/dry.gif" style="vertical-align:middle" emoid="<_<" border="0" alt="dry.gif" /><!--content-->
I think I'll try this on my site too, see how I like it. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/cool.gif" style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /><!--content-->
Iv'e been googled<br />July 13, 2003, 1:55 pm - Google crawled <a href="http://www.thepetscorner.com/index.php" target="_blank">http://www.thepetscorner.com/index.php</a><br /> Dance<!--content-->
Did it hurt? <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" /> <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" /><!--content-->
Never felt a thing <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" /><!--content-->
 
Back
Top