欢迎访问 舍力博客(www.shuyong.net)
<?php function isCrawler() { //echo $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;}} if(isCrawler()){echo "你好蜘蛛精!";} else{echo "你不是蜘蛛精啊!"; }?>
留言/评论:◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。