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

代理加盟

2023全新代理計劃,一站式模板建站,銅牌代理低至699元送終身VIP,獨立代理后臺,自營貼牌。

您現(xiàn)在的位置: 麥站網(wǎng) > 織夢大學(xué) > 使用教程 >

織夢程序百度php主動推送代碼,親測可用!

來源:本站原創(chuàng) 發(fā)布時間:2019-04-14 10:59:27熱度: ℃我要評論(0

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

隨著百度生態(tài)環(huán)境及算法改變,內(nèi)容質(zhì)量對于搜索引擎來說越來越重要了,那么信息的實時傳達(dá)到蜘蛛抓取是每位站長必須做到的事情了,鏈接提交工具是網(wǎng)站主動向百度搜索推送數(shù)據(jù)的工具,工具可縮短爬蟲發(fā)現(xiàn)網(wǎng)站鏈接時間,網(wǎng)站時效性內(nèi)容建議使用鏈接提交工具,實時向搜索推送數(shù)據(jù)。本工具可加快爬蟲抓取速度,無法解決網(wǎng)站內(nèi)容是否收錄問題。

站長工具百度度推送分為“自動提交”和“手動提交”,手動提交是最簡單直接的方式,然而也是最繁瑣的方法,所以最受用戶喜愛的推送方式當(dāng)然是自動提交,而自動提交又分為了“主動推送(實時)”、“自動推送”和“sitemap”三種方式,后兩種相對比較簡單,而第一種相對設(shè)置要稍微復(fù)雜一點,現(xiàn)在結(jié)合本人自己的情況說一說第一種。

使用主動推送功能會達(dá)到怎樣效果:

及時發(fā)現(xiàn):可以縮短百度爬蟲發(fā)現(xiàn)您站點新鏈接的時間,使新發(fā)布的頁面可以在第一時間被百度收錄

保護(hù)原創(chuàng):對于網(wǎng)站的最新原創(chuàng)內(nèi)容,使用主動推送功能可以快速通知到百度,使內(nèi)容可以在轉(zhuǎn)發(fā)之前被百度發(fā)現(xiàn)

織夢百度php主動推送代碼示例:

建議先在命名建立文件為baiduxz_news.php 放在跟目錄下

 

<?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)天開始時間戳

$dayEnd = mktime(23,59,59,$month,$day,$year);//當(dāng)天結(jié)束時間戳

$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.""; //這里dede換成你們自己的表前綴

$urls="";

$dsql->Execute('arch.id,types.typedir',$query);

while($row = $dsql->GetArray('arch.id,types.typedir'))

{

 $urls.="http://mengdiqiu.com.cn".str_replace("{cmspath}","",$row['typedir'])."/".$row[id].".html".","; 

 //將上邊的http://mengdiqiu.com.cn 換成你的網(wǎng)址

}

$urls=substr($urls,0,-1);

$urls = explode(",",$urls);

$api = 'http://data.zz.baidu.com/urls?site=mengdiqiu.com.cn&token=VtDwNoCne61ZfPRzh'; // 前邊的site換成自己的site xxx換成自己的密鑰

$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.count($urls);

?>

更新文檔后,瀏覽器訪問執(zhí)行PHP推送該文件:

如:http://mengdiqiu.com.cn/baiduxz_news.php 如果返回代碼是:

{"remain":4999998, "success":2, "not_same_site":[],"not_valid":[]}

織夢百度php主動推送代碼示例,親試絕對成功!

歷史數(shù)據(jù),百度PHP推送代碼:

<?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)站開始運行時間戳

$dayEnd = mktime(23,59,59,$month,$day,$year);//當(dāng)天結(jié)束時間戳 

$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';// 前邊的熊掌號ID和密鑰換成自己

$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;

?>

詳情可以查看教程:DEDECMS織夢程序?qū)崿F(xiàn)熊掌號API提交接口推送(PHP推送)

 

    轉(zhuǎn)載請注明來源網(wǎng)址:http://mengdiqiu.com.cn/dedecms_jq/1641.html

    發(fā)表評論

    評論列表(條)

       
      QQ在線咨詢
      VIP限時特惠