//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;
}
Will this function miss any bots?
Started by codytaylor, Jun 13 2009 11:00 PM
4 replies to this topic
#1
Posted 13 June 2009 - 11:00 PM
Did I miss anything obvious? Just double checking. It seems to be working fine.
|
|
|
#2
Guest_Jordan_*
Posted 14 June 2009 - 06:07 AM
Guest_Jordan_*
What is the Bing cralwer named? What type of bots are you looking for specifically?
#3
Posted 14 June 2009 - 07:51 AM
#4
Posted 14 June 2009 - 12:46 PM
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
Posted 08 August 2009 - 05:55 PM
Normally, bot names are {SEARCHENGINENAME}_bot.
eg. GOOGLE_bot.
Also Nambu bot is like this: Nambu_11_bot
Rep me please.
eg. GOOGLE_bot.
Also Nambu bot is like this: Nambu_11_bot
Rep me please.


Sign In
Create Account

Back to top









