分享网正式开通,我们为大家提供免费资源,欢迎大家踊跃投稿!

织梦熊掌号api自动提交 上传根目录即可

文件名1.php,可以放在网站根目录,到时候每天点一下就行了!只适用于自适应站点

  1. <?php
  2. require_once ("include/common.inc.php");
  3. require_once "include/arc.partview.class.php";
  4. require_once('include/charset.func.php');
  5. $year = date("Y");
  6. $month = date("m");
  7. $day = date("d");


  1. $dayBegin = mktime(0,0,0,$month,$day,$year);



  1. $dayEnd = mktime(23,59,59,$month,$day,$year);


  1. $query = "SELECT arch.id,types.typedir FROM dede_arctype as types inner join dede_archives as arch on types.id=arch.typeid where pubdate<".$dayEnd." AND pubdate>".$dayBegin."";
  2. //echo $query;
  3. $urls="";
  4. $dsql->Execute('arch.id,types.typedir',$query);
  5. while($row = $dsql->GetArray('arch.id,types.typedir'))
  6. {
  7. $urls.="https://www.19tx.cn".str_replace("{cmspath}","",$row['typedir'])."/".$row[id].".html".",";
  8. }
  9. $urls=substr($urls,0,-1);
  10. $urls = explode(",",$urls);



  1. $api = 'http://data.zz.baidu.com/urls?appid=熊掌号ID&token=密钥&type=realtime'; // 前边的熊掌号ID和密钥换成自己的



  1. $ch = curl_init();
  2. $options = array(
  3. CURLOPT_URL => $api,
  4. CURLOPT_POST => true,
  5. CURLOPT_RETURNTRANSFER => true,
  6. CURLOPT_POSTFIELDS => implode("\n", $urls),
  7. CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
  8. );
  9. curl_setopt_array($ch, $options);
  10. $result = curl_exec($ch);
  11. echo $result;
  12. ?>

爱资源分享网 , 版权所有丨本站资源仅限于学习研究,严禁从事商业或者非法活动!丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:织梦熊掌号api自动提交 上传根目录即可
喜欢 ()分享 (0)