欢迎来到万象站长学堂!

DedeCMS

当前位置: 主页 > CMS教程 > DedeCMS > 文章列表

织梦熊掌号api自动提交代码

时间:2026-11-16 18:25:18|栏目:DedeCMS|点击:3 次

复制一下PHP代码,新建一个PHP文件,放在网站根目录,每天更新完后运行一次就行了!只适用于自适应站点。

<?php  require_once ("include/common.inc.php");  
require_once "include/arc.partview.class.php";
require_once('include/charset.func.php');  
$year = date("Y");  $month = date("m"); 
$day = date("d");
$dayBegin = mktime(0,0,0,$month,$day,$year);
$dayEnd = mktime(23,59,59,$month,$day,$year);
$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.""; 
//echo $query;  
$urls="";  
$dsql->Execute('arch.id,types.typedir',$query); 
while($row = $dsql->GetArray('arch.id,types.typedir'))  { $urls.="https://www.19tx.cn";.str_replace("{cmspath}","",$row['typedir'])."/".$row[id].".html".",";  } 
$urls=substr($urls,0,-1);  
$urls = explode(",",$urls);
$api = 'http://data.zz.baidu.com/urls?appid=熊掌号ID&token=密钥&type=realtime'; 
// 前边的熊掌号ID和密钥换成自己的$ch = curl_init();  
$options = array(  CURLOPT_URL => $api,  CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,  CURLOPT_POSTFIELDS => implode("n", $urls), CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),  );  
curl_setopt_array($ch, $options); 
$result = curl_exec($ch);  
echo $result;  
?>

上一篇:织梦CMS管理员帐号密码忘记了怎么办?

栏    目:DedeCMS

下一篇:dedecms调用当前文章所属栏目名

本文标题:织梦熊掌号api自动提交代码

本文地址:https://zhanzhang.eapis.site/html/23837.html

您可能感兴趣的文章

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:120507403 | 邮箱:120507403@qq.com

Copyright © 2002-2026 万象站长学堂 版权所有沪ICP备2021023961号-8 粤公网安备 13010202004186