function ox_baidu_url_submit($tids){ foreach ($tids as $key=>$value){ $urls[] = 'http://你的域名/forum.php?mod=viewthread&tid='.$value; } $api = 'http://data.zz.baidu.com/urls?site=你的域名&token=你的Tonken'; $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); return $result; } 復(fù)制代碼 |
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: discuz 實(shí)現(xiàn)發(fā)布文章 自動(dòng)提交到百度 ox_baidu_url_submit($tids