Jump to content

Will this function miss any bots?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
codytaylor

codytaylor

    Newbie

  • Members
  • Pip
  • 2 posts
Did I miss anything obvious? Just double checking. It seems to be working fine.


//returns 1 if the user agent is a bot

function is_bot($user_agent)

{

  //if no user agent is supplied then assume it's a bot

  if($user_agent == "")

    return 1;


  //array of bot strings to check for

  $bot_strings = Array(  "google",     "bot",

            "yahoo",     "spider",

            "archiver",   "curl",

            "python",     "nambu",

            "twitt",     "perl",

            "sphere",     "PEAR",

            "java",     "wordpress",

            "radian",     "crawl",

            "yandex",     "eventbox",

            "monitor",   "mechanize",

            "facebookexternal"

          );

  foreach($bot_strings as $bot)

  {

    if(strpos($user_agent,$bot) !== false)

    { return 1; }

  }

  

  return 0;

}




#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
What is the Bing cralwer named? What type of bots are you looking for specifically?

#3
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
want a bot list?
IPBots

#4
codytaylor

codytaylor

    Newbie

  • Members
  • Pip
  • 2 posts

Jordan said:

What is the Bing cralwer named? What type of bots are you looking for specifically?

I'm just trying to identify the real visitors from the bots.

#5
Ascension

Ascension

    Learning Programmer

  • Members
  • PipPipPip
  • 42 posts
Normally, bot names are {SEARCHENGINENAME}_bot.

eg. GOOGLE_bot.



Also Nambu bot is like this: Nambu_11_bot


Rep me please.