复制一下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; ?>
API
2022-06-15 121API是开发中必备知识点,合理的应用API可以大大节省开发成本,为您整理收集了包含API接口的信息,包含API接口,API代码,API源码,助你更快的学习使用API技术....
- 带五套模板的API接口系统源码 [2024-01-18]
- layui框架API接口调用管理系统源码 [2024-01-16]
- 小西瓜API管理系统源码2.0 [2023-12-07]
- ApiDebug在线api接口调试浏览器插件 [2023-12-07]
- 抖音短视频去水印官方API接口源码 [2023-10-04]