織夢(mèng)cms實(shí)時(shí)推送sitemap地址給百度,織夢(mèng)技術(shù)
導(dǎo)讀:織夢(mèng)技術(shù)織夢(mèng)技術(shù)很久前,織夢(mèng)自己有一套主動(dòng)ping百度的插件,但是后來(lái)好像有幾年用不了了. 最近百度推出了實(shí)時(shí)推送鏈接地址給百度,這樣肯定比sitemap方便多了.而且也可以確織夢(mèng)網(wǎng)站模板織夢(mèng)模板免費(fèi)下裁。
很久前,織夢(mèng)自己有一套主動(dòng)ping百度的插件,但是后來(lái)好像有幾年用不了了.
最近百度推出了實(shí)時(shí)推送鏈接地址給百度,這樣肯定比sitemap方便多了.而且也可以確保文章的原創(chuàng)性.
不知道為什么我在網(wǎng)上還沒(méi)看到織夢(mèng)有這樣的教程,所以我就根據(jù)百度接口寫(xiě)了個(gè)教程出來(lái),給各位織夢(mèng)愛(ài)好者看看.
關(guān)于織夢(mèng)的百度實(shí)時(shí)推送我寫(xiě)了兩種方法,大家可以自行選擇:
1、
手動(dòng)創(chuàng)建一個(gè)文件,每天訪問(wèn)這個(gè)文件就可以把當(dāng)天的全部文章推送到百度搜索引擎.
在根目錄下面創(chuàng)建一個(gè)fcz8k.php 訪問(wèn)后會(huì)返回百度接口結(jié)果
代碼如下
<?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)天開(kāi)始時(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.""; //這里dede換成你們自己的表前綴 $urls=""; $dsql->Execute('arch.id,types.typedir',$query); while($row = $dsql->GetArray('arch.id,types.typedir')) { $urls.="http://fcz8k.com".str_replace("{cmspath}","",$row['typedir'])."/".$row[id].".html".","; //將上邊的http://fcz8k.com換成你的網(wǎng)址 } $urls=substr($urls,0,-1); $urls = explode(",",$urls); $api = 'http://data.zz.baidu.com/urls?site=youwujun.com.cn&token=xxxxx'; // 前邊的site換成自己的site xxx換成自己的密鑰 $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.count($urls); ?> 百度接口返回說(shuō)明:
關(guān)鍵詞標(biāo)簽: 織夢(mèng) 標(biāo)簽 實(shí)時(shí)
聲明: 本文由我的SEOUC技術(shù)文章主頁(yè)發(fā)布于:2023-07-18 ,文章織夢(mèng)cms實(shí)時(shí)推送sitemap地址給百度,織夢(mèng)技術(shù)主要講述實(shí)時(shí),標(biāo)簽,織夢(mèng)網(wǎng)站建設(shè)源碼以及服務(wù)器配置搭建相關(guān)技術(shù)文章。轉(zhuǎn)載請(qǐng)保留鏈接: http://www.bifwcx.com/article/web_29366.html
為你推薦與織夢(mèng)cms實(shí)時(shí)推送sitemap地址給百度,織夢(mèng)技術(shù)相關(guān)的文章
-
當(dāng)前欄目調(diào)用上級(jí)欄目名稱(chēng)的辦法,織夢(mèng)文
(106)人喜歡 2023-07-18 -
Dedecms自定義表單后臺(tái)列表展現(xiàn)方式更改
(142)人喜歡 2023-07-18 -
用SQL命令刪除dede版權(quán)信息的官方鏈接,D
(124)人喜歡 2023-07-18 -
Dedecms后臺(tái)驗(yàn)證碼不顯示的解決方法,織夢(mèng)
(102)人喜歡 2023-07-18 -
Dedecms搜索頁(yè)面調(diào)用最新文章的方法,織夢(mèng)
(77)人喜歡 2023-07-18 -
DedeCMS轉(zhuǎn)換WordPress方法-親測(cè)成功,DEDE技術(shù)
(183)人喜歡 2023-07-18