$useragent = addslashes(strtolower($_server[‘http_user_agent’]));
if (strpos($useragent, ‘googlebot’)!== false){$bot = ‘google’;}
elseif (strpos($useragent,’mediapartners-google’) !== false){$bot = ‘google adsense’;}
elseif (strpos($useragent,’baiduspider’) !== false){$bot = ‘baidu’;}
elseif (strpos($useragent,’sogou spider’) !== false){$bot = ‘sogou’;}
elseif (strpos($useragent,’sogou web’) !== false){$bot = ‘sogou web’;}
elseif (strpos($useragent,’sosospider’) !== false){$bot = ‘soso’;}
elseif (strpos($useragent,’360spider’) !== false){$bot = ‘360spider’;}
elseif (strpos($useragent,’yahoo’) !== false){$bot = ‘yahoo’;}
elseif (strpos($useragent,’msn’) !== false){$bot = ‘msn’;}
elseif (strpos($useragent,’msnbot’) !== false){$bot = ‘msnbot’;}
elseif (strpos($useragent,’sohu’) !== false){$bot = ‘sohu’;}
elseif (strpos($useragent,’yodaobot’) !== false){$bot = ‘yodao’;}
elseif (strpos($useragent,’twiceler’) !== false){$bot = ‘twiceler’;}
elseif (strpos($useragent,’ia_archiver’) !== false){$bot = ‘alexa_’;}
elseif (strpos($useragent,’iaarchiver’) !== false){$bot = ‘alexa’;}
elseif (strpos($useragent,’slurp’) !== false){$bot = ‘雅虎’;}
elseif (strpos($useragent,’bot’) !== false){$bot = ‘其它蜘蛛’;}
if(isset($bot)){
$fp = @fopen(‘bot.txt’,’a’);
fwrite($fp,date(‘y-m-d h:i:s’).”\t”.$_server[“remote_addr”].”\t”.$bot.”\t”.’http://’.$_server[‘server_name’].$_server[“request_uri”].”\r\n”);
fclose($fp);
}
希望与广大网友互动??
点此进行留言吧!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:http://bianchenghao.cn/34165.html