Here is the simple function for detecting spiders and robots. It will return true or false.
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.
function is_bot(){
$bots = array(
'Googlebot',
'Baiduspider',
'ia_archiver',
'R6_FeedFetcher',
'NetcraftSurveyAgent',
'Sogou web spider',
'bingbot',
'Yahoo! Slurp',
'facebookexternalhit',
'PrintfulBot',
'msnbot',
'Twitterbot',
'UnwindFetchor',
'urlresolver',
'Butterfly',
'TweetmemeBot');
foreach($bots as $b){
if( stripos( $_SERVER['HTTP_USER_AGENT'], $b ) !== false ) return true;
}
return false;
}
|
Hello Friends! I am Ramana a part time blogger from Hyderabad.
0 comments:
Post a Comment