本文共 1437 字,大约阅读时间需要 4 分钟。
require_once(dirname(__FILE__).'/../../include/common.inc.php');
require_once(DEDEINC."/arc.partview.class.php");
require_once(dirname(__FILE__).'/../../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".$dayBegin."";
//echo $query;
$urls="";
$dsql->Execute('arch.id,types.typedir',$query);
while($row = $dsql->GetArray('arch.id,types.typedir'))
{
$urls.="$urls.="https://www.xiuzhanwang.com".str_replace("{cmspath}","",$row['typedir'])."/".$row[id].".html".",";".",";
}
$urls=substr($urls,0,-1);
$tjurl = $urls;
$urls = explode(",",$urls);
$api = 'http://data.zz.baidu.com/urls?appid=1567968668883362&token=TqR2soisGxVnnKiN&type=realtime'; // 熊掌号api接口调用地址
$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;
$dsql->ExecuteNoneQuery("Update `xiuzhanwang_sys_task` set sta='成功' where dourl='xzh.php' ");
$jieguo = date('Y-m-d H:i:s',time())."返回结果:".$result."\r\n".$tjurl;
$numbytes = file_put_contents('xzh.txt', $jieguo); //返回结果
exit();
转载地址:https://blog.csdn.net/weixin_33642922/article/details/115235640 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!