sSJHTML5中文学习网 - HTML5先行者学习网
可以记录Baidu,Google,Bing,Yahoo,Soso,Sogou,Yodao爬行网站的记录
代码如下:sSJHTML5中文学习网 - HTML5先行者学习网
| 02 | //http://www.tongqiong.com |
| 03 | function get_naps_bot() |
| 05 | $useragent = strtolower($_SERVER['HTTP_USER_AGENT']); |
| 07 | if (strpos($useragent, 'googlebot') !== false){ |
| 11 | if (strpos($useragent, 'baiduspider') !== false){ |
| 14 | if (strpos($useragent, 'msnbot') !== false){ |
| 18 | if (strpos($useragent, 'slurp') !== false){ |
| 22 | if (strpos($useragent, 'sosospider') !== false){ |
| 26 | if (strpos($useragent, 'sogou spider') !== false){ |
| 30 | if (strpos($useragent, 'yodaobot') !== false){ |
| 37 | $date=date("Y-m-d.G:i:s"); |
| 41 | $searchbot = get_naps_bot(); |
| 44 | $tlc_thispage = addslashes($_SERVER['HTTP_USER_AGENT']); |
| 45 | $url=$_SERVER['HTTP_REFERER']; |
| 46 | $file="www.tongqiong.com.txt"; |
| 48 | $data=fopen($file,"a"); |
| 49 | fwrite($data,"Time:$time robot:$searchbot URL:$tlc_thispage/n"); |
| 52 | //http://www.tongqiong.com |
sSJHTML5中文学习网 - HTML5先行者学习网sSJHTML5中文学习网 - HTML5先行者学习网