Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 7 of 7

This is a discussion on separating Bots&Crawlers from real visitors? in the Shared & Semi-Dedicated forum
Hey. Is there a way I can tell the difference between real visitors and bots, using php? I'm working on a stats script for my ...

  1. #1
    Smo
    Smo is offline
    JPC Addict
    Join Date
    Nov 2002
    Location
    Finland
    Posts
    218

    separating Bots&Crawlers from real visitors?

    Hey.

    Is there a way I can tell the difference between real visitors and bots, using php? I'm working on a stats script for my site, and would like to tell the difference between them.

    Where do I start!?

  2. #2
    || $name ne 'R.Stiltskin'
    Join Date
    Jun 2003
    Location
    Tejas
    Posts
    2,438
    Hmmm. I don't work with PHP but mod_rewrite has tools to identify and dump them. However, like anything, you'd have to define the rules to catch 'em.

    Have you checked for a list of known bots? You might have to set up an array and match visitor user agent headers to the bot array values to allow/deny that visitor.

    I don't know of any easy way to detect them, particularly if the header is forged. The bad bots, and the ones most detrimental to your site, won't want to identify themselves... assuming, of course, that they provide an agent header at all. Also, not all legitimate visitors pass complete headers either.

    Sorry to be of so little help.

  3. #3
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    You use the UA (User Agent) filed in the headers. Here's a page I googled for ya:

    http://danzcontrib.free.fr/en/pieges.php

    Includes a php proggie you can dissect for your own porpoises.

  4. #4
    Smo
    Smo is offline
    JPC Addict
    Join Date
    Nov 2002
    Location
    Finland
    Posts
    218
    Thanks

    Now to work on the scrpt.
    I don't wanna deny anyone (maybe 'bad crawlers' later on), just make a nice log/statistics script

  5. #5
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,306
    Yeah, I guessed you didn't want to deny folks, but the script gave you actual code to compare a list of bots to the UA in php, which should be darn close to what you need to do.

    Get the list of UAs you want, stick'em into the array, compare against the UA and set a variable for use in the script that says this visitor is a bot, or not.

    Good luck.

  6. #6
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Short answer... no!
    Last edited by Vin DSL; 01-30-2005 at 06:44 PM.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  7. #7
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Last edited by Vin DSL; 01-30-2005 at 06:45 PM.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •