织梦熊掌号api自动提交 上传根目录即可
文件名1.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;
?>
常见问题FAQ
- 链接地址失效了怎么办?
- 例如蓝奏盘,https://www.lanzous.com/i1b2oib 把S改成m或i即可解决,或者请联系本站修复!
- 本站资源和文章版权声明
- 版权声明:本站部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们,减少损失。联系邮箱:1453316800@qq.com
- 点击下载链接不跳转怎么回事?
- 您好,QQ内打开是不跳转的,少部分浏览器也不跳转,一般的谷歌,UC了,搜狗 360等浏览器都可以跳转。