Forum Moderators: open

Message Too Old, No Replies

Coding a spider

How to give yourself an agent name

         

chris_f

8:09 am on May 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am thinking of building a small time search engine for one of my sites. I wish people to see that I am crawling their site. For instance, I want them to see BotA instead of my IP Address. How do I declare an agent name for peoples logs?

Any know?

PsychoTekk

8:54 am on May 15, 2002 (gmt 0)

10+ Year Member



it's impossible to replace the IP, but you can set the HTTP_USER_AGENT variable to "BotA", so in their logs the bot's name will show up.
the client side name of the variable is 'User-Agent' (HTTP_USER_AGENT is the serverside variable that contains the name string)
for example:
GET ... HTTP/1.1
Host: ...
User-Agent: BotA
Connection: close

Brett_Tabke

9:03 am on May 15, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



It all depends upon the language and interface chris. It is doubtful, that you will be managing the http connection yourself, but there will probably be some setting somewhere to adjust the user agent header.

chris_f

9:04 am on May 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's exactly what I was looking for thanks. My question is, however, how would I make the user agent say BotA when I grab the pages for the search engine. I am coding in ASP.net if anyone can help.

P.S. I didn't make my question clear. I wasn't trying to alter the IP Address field.

PsychoTekk

9:07 am on May 15, 2002 (gmt 0)

10+ Year Member



i myself have no idea od ASP but this might help you:
[aspfusion.net...]

jdMorgan

6:53 pm on May 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



chris_f,

And, after having read around in this forum, I'd recommend adding a valid e-mail address, or even better, a web page URL in the UA for your fellow wmw webmasters to check on your robot when they spot it in their logs.

My policy is to block any unknown robot I can't check out, and it looks like several others here do the same...

Cheers,

Jim