Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    主动给百度爬虫提交链接的个人小经验

    灌水区
    1
    1
    1060
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • tigger
      tigger LV 7 last edited by

      f48abff5-a4b6-4dc4-a305-8581d1db2f24-image.png

      打开百度资源: https://ziyuan.baidu.com/

      首先要认证自己的域名

      然后可以如上图获得 token , 这样可以通过此 token 用脚本提交 链接

      baidu_ziyuan_post_test.sh

      #!/usr/bin/php
      
      <?php
      
      echo " ------------- \n";
      
      while (1)
      {
              $i = rand(1, 7000);
              $url = "https://bbs.aw-ol.com/topic/${i}";
              echo $url;
      
              $api = 'http://data.zz.baidu.com/urls?site=bbs.aw-ol.com&token=PCsGS75NhQJZWVAr';
      
              $ch = curl_init();
              $options =  array(
                      CURLOPT_URL => $api,
                      CURLOPT_POST => true,
                      CURLOPT_RETURNTRANSFER => true,
                      CURLOPT_POSTFIELDS => $url,
                      CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
              );
      
              curl_setopt_array($ch, $options);
              $result = curl_exec($ch);
              echo $result;
              $sleep_second = rand(60, 300);
              sleep($sleep_second);
              echo " ${sleep_second}";
              echo "\n";
      }
      ?>
      

      a664d4c7-7412-46c1-9d32-9028d227ab4b-image.png

      有时候一天收录量可以增加 1000多

      1 Reply Last reply Reply Quote Share 1
      • 1 / 1
      • First post
        Last post

      Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

      行为准则 | 用户协议 | 隐私权政策