Click here to Skip to main content
6,634,665 members and growing! (21,686 online)
Email Password   helpLost your password?
Web Development » Client side scripting » General     Intermediate

How to be notified a website is crawled by Google?

By Alex Douma

This article explains a code snippet in how to receive a notification when google hits a website.
Javascript, HTML, Dev
Posted:9 Sep 2006
Views:10,639
Bookmarked:14 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
9 votes for this article.
Popularity: 2.02 Rating: 2.12 out of 5
4 votes, 44.4%
1
3 votes, 33.3%
2
1 vote, 11.1%
3

4
1 vote, 11.1%
5

Introduction

It was always a question to me that how to be notified when a search engine robot like google's reaches to a website. On the other hand I was wondering about receiving a notification as soon as google explores my website.

I spent sometime on google and searched the internet to see if I can find a trick or technique to employ it to receive a notification once my website is hit by google itself. The question is not why it is important to know when the website is crawled by google, but the question is how to achieve this goal?!

Code Snippet

First of all, please don't expect that this article should describe an algorithm or a lengthy sample code. This is only a small but useful technique. I ran into the following PHP code snippet in PHP on a weblog somewhere on internet :


if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Googlebot' ) !== false )
{
// The email address we want to send the email to
$email_address = 'MyName@MyDomain.com';


mail($emai_address,'Google bot','The website is hit by google now.','from@MyDomain.com');


}
In the body of above 'if' statement an email is sent to MyName@MyDomain.com once the website is hit by google. Even we can send a notification to cell phones too if google reaches to a website. All we need is to substitute the code inside the 'if' block with a certain of instructions to trigger a SMS to a cell phone via web as it is described in this weblog.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Alex Douma


Member
- B.S. degree in Computer Engineering.
- 10+ years experience in Turbo C, Borland C , Visual C++ and Managed C++.
- Obssessed in OOP style design and programming.
- Desigining and developing Network security tools.
- Desigining and developing a client/server appliation for sharing files among users in a way other than FTP protocol.
- Desigining and developing ISP Subscribers account management by binding to Cisco tools (NtTac+), Reporting the results on the web by ISAPI method.
- Designing and writing code to build a search engine (Web crawler) by SQL Server 7.0 and VC++.

- On-board programming of non-boundary scan memory devices like flash memories by boundary scan (IEEE 1149.1) protocol in C# and J#.

- Designing and implementing GSM gateway applications and bulk messaging.

The summary of my skills:
C#, J#, Managed C++ code, VC++, MFC, Turbo Pascal, PL/I, SQL Server, MS Access, Windows NT administration, Web site developing, Macromedia tools, Webmastering, Cisco Routers.

Occupation: Web Developer
Location: Canada Canada

Other popular Client side scripting articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 3 of 3 (Total in Forum: 3) (Refresh)FirstPrevNext
QuestionNice Info Pinmemberstixoffire20:40 15 Jun '09  
Generalhow to achive in asp.net c# Pinmembercb mehta1:48 25 Aug '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 9 Sep 2006
Editor:
Copyright 2006 by Alex Douma
Everything else Copyright © CodeProject, 1999-2009
Web20 | Advertise on the Code Project