Copy CodeThe code is as follows:
/**
* Judging whether the search engine spider
*
* @author Eddy
* @return BOOL
*/
function Iscrawler () {
$agent = Strtolower ($_server[' http_user_agent ');
if (!empty ($agent)) {
$spiderSite = Array (
"Tencenttraveler",
"Baiduspider+",
"Baidugame",
"Googlebot",
"MSNBot",
"Sosospider+",
"Sogou web Spider",
"Ia_archiver",
"Yahoo! slurp",
"Youdaobot",
"Yahoo slurp",
"MSNBot",
"Java (Often spam bot)",
"Baiduspider",
"Voila",
"Yandex bot",
"Bspider",
"Twiceler",
"Sogou Spider",
"Speedy Spider",
"Google AdSense",
"Heritrix",
"Python-urllib",
"Alexa (IA archiver)",
"Ask",
"Exabot",
"Custo",
"Outfoxbot/yodaobot",
"YaCy",
"Surveybot",
"Legs",
"Lwp-trivial",
"Nutch",
"Stackrambler",
"The Web Archive (IA archiver)",
"Perl Tool",
"Mj12bot",
"Netcraft",
"Msiecrawler",
"WGet Tools",
"Larbin",
"Fish Search",
);
foreach ($spiderSite as $val) {
$str = Strtolower ($val);
if (Strpos ($agent, $STR)!== false) {
return true;
}
}
} else {
return false;
}
}
http://www.bkjia.com/PHPjc/324085.html www.bkjia.com true http://www.bkjia.com/PHPjc/324085.html techarticle Copy the code as follows:/** * determine if search engine spider * * @author Eddy * @return bool */function Iscrawler () {$agent = Strtolower ($_server[' HT Tp_user_agent ']); if (!e ...