织梦熊掌号api自动提交代码
4448
织梦熊掌号api自动提交代码,复制一下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://你的域名".str_replace("{cmspath}","",$row['typedir'])."/".$row[id].".html".","; } $urls=substr($urls,0,-1); $urls = explode(",",$urls); $api = 'http://data.zz.baidu.com/urls?appid=<a href="http://你的域名/tags/xzh/" target="_blank">熊掌号</a>ID&token=密钥&type=realtime'; $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; ?>
本文网址:https://www.zztuku.com/detail-7696.html
站长图库 - 织梦熊掌号api自动提交代码
申明:如有侵犯,请 联系我们 删除。
您还没有登录,请 登录 后发表评论!
提示:请勿发布广告垃圾评论,否则封号处理!!