|
楼主 |
发表于 2012-11-3 23:06:53
|
显示全部楼层
来自 中国福建漳州
匿名者 发表于 2012-11-3 22:58
楼主的站被百度K了吗? - <?php
- // 判断用户是不是蜘蛛
- 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",
- "360Spider"
- );
- foreach($spiderSite as $val) {
- $str = strtolower($val);
- if (strpos($agent, $str) !==false) {
- return true;
- }
- }
- } else {
- return false;
- }
- }
- //if (isCrawler()){
- // echo "你好蜘蛛精!";
- //}
- //else{
- // echo "你不是蜘蛛精啊!";
- //}
- ?>
复制代码 |
|