// $cachename:文件生成的地方和文件名,既你要放置的地方
function writefiles($cachename,$sData)
{
$fp2 = @fopen($cachename,"w");
@flock($fp2,2);
@fwrite($fp2,$sData);
@fclose($fp2);
$mystr="ok";
return $mystr;
}
function get_naps_bot()
{
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
if (strpos($useragent, "googlebot") !== false){
return 'Googlebot';
}
if (strpos($useragent, "Googlebot") !== false){
return 'Googlebot';
}
if (strpos($useragent, "msnbot") !== false){
return "MSNbot";
}
if (strpos($useragent, "slurp") !== false){
return "Yahoobot";
}
if (strpos($useragent, 'baiduspider') !== false){
return "Baiduspider";
}
if (strpos($useragent, "sohu-search") !== false){
return "Sohubot";
}
if (strpos($useragent, "lycos") !== false){
return "Lycos";
}
if (strpos($useragent, "robozilla") !== false){
return "Robozilla";
}
if (strpos($useragent, "SpiderMan") !== false){
return "SpiderMan";
}
if (strpos($useragent, "Baiduspider") !== false){
return "Baiduspider";
}
return false;
}
$tlc_thispage = addslashes($_SERVER['HTTP_USER_AGENT']);
//添加蜘蛛的抓取记录
$searchbot = get_naps_bot();
if ($searchbot) {
$BotData="";
$BotData=$searchbot.",".$tlc_thispage.",".date("Y-m-d H:i:s");
writefiles("cache/".$searchbot.date("YmdHis").".txt",$BotData);
//echo"";
}
?>
k8
2006/10/29 09:42
分页: 1/1
[1]
[1]
关于:mambo,apache,seo
关于:P2P终结者,序列号
2006/10/29 00:22 | by 





