Click to See Complete Forum and Search --> : counter and robots


bioS
09-21-2003, 02:51 PM
Hi all,

I've a counter on my website which increments a number in a text file every time a new session is created (code in global.asa file).

I wish that my code doesn't increment this number when a session is created by a robot instead of a user.

Any idea how to make the difference between a user and a robot ?

Thanks a lot

Ribeyed
09-21-2003, 03:09 PM
hi,
i log all server variables i my database. I know when a robot or spider has hit the site because the broswer type is allways "default 0.0" . The google bot has "Googlebot/2.1 (+http://www.googlebot.com/bot.html)" as the USerAgent, so if you do an if statement on browser type you can filter out the bots.

Hope this helps.

bioS
09-21-2003, 04:52 PM
It sounds nice, but... how do you determine this browser type ?

I found something like:

set bt = server.createobject("???.BrowserType")
...
:confused:

but I can't find the way to make it work.

Could you help me ?

Ribeyed
09-21-2003, 07:59 PM
hi,


set BC = server.createobject("MSWC.BrowserType")
UserAgent = Request.Servervariables ("HTTP_USER_AGENT")
Browser = BC.Browser & " " & BC.Version

if Browser = "Default 0.0" then
'do nothing
else
'do insert statement
end if

bioS
09-22-2003, 03:49 AM
:) Thanks a lot !