if($artUrl=='')
{
$artUrl = $cfg_phpurl."/view.php?aid=$id";
} //推送开始
if(strstr($artUrl,'.html')!='')//判断是否获取到静态地址,取得静态连接就推送百度
{
preg_match('@^(?:ht删除tp://)?([^/]+)@i', $artUrl, $matches);//判断子域名并自动添加到API中
$host = $matches[1];
$urls = array(
$artUrl,
);
$api = 'ht删除tp点//data点zz点baidu点com/urls?site='.$host.'&token=你的APIkey';
$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;
}
//推送结束
ClearMyAddon($id, $title);
|