Records of Baidu,google,bing,yahoo,soso,sogou,yodao crawl sites can be recorded
The code is as follows:
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 |