织梦熊掌号api自动提交 上传根目录即可
发布时间:2019-11-03 14:19:42作者:独白浏览:未知++分类:混杂类源码朗读:

文件名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. ?>
收藏分享支持举报

免责声明

本站提供的一切软件、教程和内容信息仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑或手机中彻底删除上述内容。如果您喜欢该程序,请支持正版,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。敬请谅解!

请先后发表评论 (・ω・)
  • 全部评论(0
    还没有评论,快来抢沙发吧!

感谢您的支持

 

 

举报