av手机免费在线观看,国产女人在线视频,国产xxxx免费,捆绑调教一二三区,97影院最新理论片,色之久久综合,国产精品日韩欧美一区二区三区

php語言

PHP寫的獲取各搜索蜘蛛爬行記錄代碼

時(shí)間:2025-04-27 17:25:39 php語言 我要投稿
  • 相關(guān)推薦

PHP寫的獲取各搜索蜘蛛爬行記錄代碼

  網(wǎng)站百度蜘蛛等搜索引擎爬蟲是否了網(wǎng)站 來抓取文章,一般站長(zhǎng)不知道怎么搞用工具查詢,也可以查看空間里的日志,但是空間里的日志的記錄全是代碼你不知道那個(gè)是搜索引擎爬蟲的來路。那么下面分享一款用php寫的獲取各搜索蜘蛛爬行記錄代碼。

  支持搜索引擎如下

  可以記錄Baidu,Google,Bing,Yahoo,Soso,Sogou,Yodao爬行網(wǎng)站的記錄!

  php代碼如下

  復(fù)制代碼 代碼如下:

  <?php

  function get_naps_bot()

  {

  $useragent = strtolower($_SERVER['HTTP_USER_AGENT']);

  if (strpos($useragent, 'googlebot') !== false){

  return 'Google';

  }

  if (strpos($useragent, 'baiduspider') !== false){

  return 'Baidu';

  }

  if (strpos($useragent, 'msnbot') !== false){

  return 'Bing';

  }

  if (strpos($useragent, 'slurp') !== false){

  return 'Yahoo';

  }

  if (strpos($useragent, 'sosospider') !== false){

  return 'Soso';

  }

  if (strpos($useragent, 'sogou spider') !== false){

  return 'Sogou';

  }

  if (strpos($useragent, 'yodaobot') !== false){

  return 'Yodao';

  }

  return false;

  }

  function nowtime(){

  $date=date("Y-m-d.G:i:s");

  return $date;

  }

  $searchbot = get_naps_bot();

  if ($searchbot) {

  $tlc_thispage = addslashes($_SERVER['HTTP_USER_AGENT']);

  $url=$_SERVER['HTTP_REFERER'];

  $file="www.jb51.net.txt";

  $time=nowtime();

  $data=fopen($file,"a");

  fwrite($data,"Time:$time robot:$searchbot URL:$tlc_thispage\n");

  fclose($data);

  }

  //http://www.jb51.net收集整理

  ?>

【PHP寫的獲取各搜索蜘蛛爬行記錄代碼】相關(guān)文章:

php網(wǎng)站來路獲取代碼04-25

php獲取新浪微博數(shù)據(jù)API的實(shí)例代碼08-06

php下載代碼怎么寫07-13

PHP獲取MySQL數(shù)據(jù)庫(kù)里所有表的實(shí)現(xiàn)代碼05-28

如何在cmd下面寫php代碼06-21

php驗(yàn)證碼代碼怎么寫04-02

PHP獲取星期的方法07-06

PHP如何獲取表單07-27

PHP調(diào)用的C代碼08-05