How to Create Your Own Online Bot

You may not see robots very often around the house or on the street, but robots (or bots) have already taken over the online world. An online bot is an automated computer program that can perform tasks on the Internet in a fraction of the time required by a human user. Google, for example, owes its success to the efforts of the Googlebot, which visits and catalogs Web pages. You can create an online bot to do your bidding with only a little programming knowledge. (Code samples provided are in C#, but you'll find it easy to adapt them to other languages.)

...
Programmers often use bots to collect streams of online data.

Step

Open your development environment of choice and create a new file to contain your bot.

Step

Instantiate a URI and place it in memory. Provide the name of the website you'd like your bot to visit as a parameter:

Step

Uri sampleURI = new uri("http://www.SampleWebsite");

Step

Instantiate a WebRequest object using the sampleURI object as a parameter:

Step

WebRequest sampleWebRequest = HttpWebRequest.Create(sampleURI);

Step

Trigger the ".GetResponse()" method of the WebRequest object to obtain the contents of the target URI.

Step

sampleWebRequest.GetResponse();

Step

Use the data contained provided by the ".GetResponse()" method as needed. For example, you may wish to scan the contents of the Web page for updates.

Step

Save your work and test it to ensure it works as expected.