欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

代理加盟

2023全新代理計(jì)劃,一站式模板建站,銅牌代理低至699元送終身VIP,獨(dú)立代理后臺(tái),自營(yíng)貼牌。

您現(xiàn)在的位置: 麥站網(wǎng) > 織夢(mèng)大學(xué) > 手機(jī)站教程 >

阿里云主機(jī)、西部數(shù)碼虛擬主機(jī)渠道價(jià)
云優(yōu)原創(chuàng)模板
多城市分站站群系統(tǒng)
立即查看
Pbootcms模板
免費(fèi)可商用程序
立即查看

DEDECMS織夢(mèng)程序?qū)崿F(xiàn)熊掌號(hào)API提交接口推送(PHP推送)

來(lái)源:本站原創(chuàng) 發(fā)布時(shí)間:2019-04-14 11:02:58熱度: ℃我要評(píng)論(0

麥站模板建站平臺(tái)(10年經(jīng)驗(yàn)),服務(wù)數(shù)萬(wàn)家企業(yè),固定透明報(bào)價(jià)。域名注冊(cè)、主機(jī)/服務(wù)器、網(wǎng)站源碼一站式服務(wù)。實(shí)體公司,專業(yè)團(tuán)隊(duì),值得選擇!超過1000套模板已登記版權(quán),合規(guī)合法建站,規(guī)避版權(quán)風(fēng)險(xiǎn)!【點(diǎn)擊獲取方案】

熊掌號(hào)的API提交分為新增內(nèi)容接口歷史內(nèi)容接口兩個(gè)接口。通過新增內(nèi)容接口,提交站內(nèi) 當(dāng)天新產(chǎn)生內(nèi)容的鏈接。新增內(nèi)容享受24小時(shí)內(nèi)抓取校驗(yàn)、快速展現(xiàn)優(yōu)待。僅限提交綁定站點(diǎn)下的內(nèi)容,否則無(wú)法成功提交,配額不可累計(jì),當(dāng)日有效。而通過歷史內(nèi)容接口,每天可提交最多500萬(wàn)條有價(jià)值的內(nèi)容,所提交內(nèi)容會(huì)進(jìn)入百度搜索統(tǒng)一處理流程,這個(gè)過程需要一段時(shí)間。

一、PHP推送新增內(nèi)容接口代碼為:
 

$urls = array(
        'http://mengdiqiu.com.cn/1.html',
        'http://mengdiqiu.com.cn/2.html',
);
$api = 'http://data.zz.baidu.com/urls?appid=XXXXXXXXX&token=xxxxxxxxxxxxx&type=realtime';
$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;

DedeCMS熊掌號(hào)API提交之新增內(nèi)容接口代碼:

<?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);//當(dāng)天開始時(shí)間戳
$dayEnd = mktime(23,59,59,$month,$day,$year);//當(dāng)天結(jié)束時(shí)間戳 
 
$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://m.xiuzhanwang.com".str_replace("{cmspath}","",$row['typedir'])."/".$row[id].".html".",";
//將上邊m.xiuzhanwang.com換成你的網(wǎng)址
}
$urls=substr($urls,0,-1);
$urls = explode(",",$urls);
 
$api = 'http://data.zz.baidu.com/urls?appid=熊掌號(hào)ID&token=密鑰&type=realtime'; // 前邊的熊掌號(hào)ID和密鑰換成自己的
$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;
?>
 

二、PHP推送歷史內(nèi)容接口代碼為

$urls = array(
        'http://mengdiqiu.com.cn/1.html',
        'http://mengdiqiu.com.cn/2.html',
);
$api = 'http://data.zz.baidu.com/urls?appid=XXXXXXXXXX&token=xxxxxxxxxxxxx&type=batch';
$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;


DedeCMS熊掌號(hào)API提交之歷史內(nèi)容接口代碼:

<?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,7,1,2015);//網(wǎng)站開始運(yùn)行時(shí)間戳
$dayEnd = mktime(23,59,59,$month,$day,$year);//當(dāng)天結(jié)束時(shí)間戳 
 
$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://m.xiuzhanwang.com".str_replace("{cmspath}","",$row['typedir'])."/".$row[id].".html".",";
//將上邊的https://m.xiuzhanwang.com換成你的網(wǎng)址
}
$urls=substr($urls,0,-1);
$urls = explode(",",$urls);
 
$api = 'http://data.zz.baidu.com/urls?appid=XXXXXXXXXX&token=xxxxxxxxxxxxx&type=batch';// 前邊的熊掌號(hào)ID和密鑰換成自己
$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;
?>

代碼釋義:

1、$query中“dede_archives”為自己數(shù)據(jù)庫(kù)中存放文章的表,如果你的數(shù)據(jù)庫(kù)表頭做了修改,這里也要做相應(yīng)修改。

2、本代碼自動(dòng)獲取當(dāng)天發(fā)布的所有文章鏈接,設(shè)置兩個(gè)時(shí)間戳,0:0:0和23:59:59,也就是把當(dāng)天這兩個(gè)時(shí)間內(nèi)的文章都自動(dòng)提取出來(lái),即是當(dāng)天新增內(nèi)容內(nèi)容。

3、$api=http://data.zz.baidu.com/urls?appid=熊掌號(hào)ID&token=密鑰&type=realtime,請(qǐng)登錄您的賬號(hào)查看接口調(diào)用地址。


下載文件DedeCMS熊掌號(hào)API提交新增內(nèi)容接口文件和DedeCMS熊掌號(hào)API提交歷史內(nèi)容接口文件,解壓后,修改文件,將文件中的密鑰和網(wǎng)址改成自己的即可,將修改后的PHP文件上傳到網(wǎng)站根目錄,瀏覽器中輸入:你的域名/baiduxz_new.php和你的域名/baiduxz_old.php,即可看到API提交的效果。

網(wǎng)盤下載:https://pan.baidu.com/s/1unqgztIpc9CoU7D2voNa5w 提取碼: mjuz 

    轉(zhuǎn)載請(qǐng)注明來(lái)源網(wǎng)址:http://mengdiqiu.com.cn/dedecms_m/982.html

    發(fā)表評(píng)論

    評(píng)論列表(條)

       
      QQ在線咨詢
      VIP限時(shí)特惠