<?php /* 百度当天主动推送熊掌功能 作者:68喜科技 用于:DT7.0 功能模块:优质内容推送熊掌*出图内容当天推送 */ //引入全局变量函数 defined('IN_DESTOON') or exit('Access Denied'); $time = $today_endtime - 30*86400; $time = time(); $starttime = $time - 24*3600;//24小时 $limitList=20; //限制条数 $query = "SELECT linkurl FROM {$DT_PRE}article_24 WHERE edittime > $starttime AND thumb<>'' ORDER BY itemid ASC LIMIT $limitList"; //查询当天出图的数据URL //开始全部推送 $result = $db->query($query); $urls=""; $domain="http://m.xuetong365.com/story/"; while ($r=$db->fetch_array(($result))) { $linkurl = $r['linkurl']; //修改域名 $urls.=$domain.$linkurl.","; } $urls=substr($urls,0,-1); $urls = explode(",",$urls); //百度熊掌推送 $api = '熊掌API'; $ch = curl_init(); $options = array( CURLOPT_URL => $api, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => implode(" ", $urls), CURLOPT_HTTPHEADER => array('Content-Type: text/plain'), ); curl_setopt_array($ch, $options); $result = curl_exec($ch); echo $result; ?>