当前位置:网站首页>Use the pagoda panel to plan tasks and automatically push the website to Baidu for inclusion
Use the pagoda panel to plan tasks and automatically push the website to Baidu for inclusion
2022-07-24 02:20:00 【Website construction shadow】
Create a new one in the root directory of the site PHP file , for example :baidu.php, And copy the code below to add a band baidu.php In file .
Be careful : Two bloggers who need to modify have added comments at the end , Remember to change it to your own , Then save .
<?php
header('Content-Type:text/html;charset=utf-8');
/** Just modify the two links **/
$xml_url = "http:// domain name /sitemap.xml"; // Modify your site here xml Map Links
$baidu_api = 'http://data.zz.baidu.com/urls?site=https://www.91084.com&token=123456789';// Here it is modified as the push interface you get from Baidu webmaster
/*** Just modify the two links **/
$xmldata =file_get_contents($xml_url);
$xmlstring = simplexml_load_string($xmldata,'SimpleXMLElement',LIBXML_NOCDATA);
$value_array = json_decode(json_encode($xmlstring),true);
$url = [];
for ($i =0;$i < count($value_array['url']);$i++){
// echo $value_array['url'][$i]['loc']."<br/>";
$url[]= $value_array['url'][$i]['loc'];
}
// Baidu push interface only supports push at a time 2000 Data , So over 2000 You need to push in groups
$url_group = array_chunk($url,2000);
$count=count($url_group);
for($i=0;$i<$count;$i++){
$ch = curl_init();
$options = array(
CURLOPT_URL => $baidu_api,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => implode("\n",$url_group[$i]),
CURLOPT_HTTPHEADER => array('Content-Type:text/plain'),
);
curl_setopt_array($ch, $options);
$result =curl_exec($ch);
curl_close($ch);
echo $result;
}
?>
The second step :
Log in to your pagoda panel , Follow the following figure to finish .

边栏推荐
- Using tessellation in unity
- The difference between.Split (",", -1) and.Split (",")
- Responsive layout a web page displays different effects on different devices) meta:vp
- [Luogu] p1318 ponding area
- 暗黑系王者,低照度图像增强技术解析
- 分布式资源管理与任务调度框架Yarn
- NetApp FAS系列一个CIFS bug引起的控制器重启案例分享
- Async await details & Promise
- canvas-绘图(鼠标按下 绘制 抬起 结束)
- 浅谈领域驱动设计
猜你喜欢

Use the hiflow scene connector to view the epidemic situation in the region every day

利用宝塔面板计划任务执行自动推送网址到百度收录

Crud operation of mongodb (2)

浅谈领域驱动设计

杂志特稿:元宇宙将重塑我们的生活,我们要确保它变得更好
![[重要通知]星球线上培训第三期来袭!讲解如何在QTYX上构建自己的量化策略!...](/img/37/f9ea9af069f62cadff21415f070223.png)
[重要通知]星球线上培训第三期来袭!讲解如何在QTYX上构建自己的量化策略!...

Build a CPU Simulator

POP3客户端代码的实现

Combined with actual combat, analyze gb/t 28181 (II) -- equipment directory synchronization

Local empowerment learning
随机推荐
奔走相告,行情与量化页面功能优化!股票量化分析工具QTYX-V2.4.5
Ggplot2 displays png
5年接触近百位老板,身为猎头的我,发现升职的秘密不过4个字
In depth understanding - wechat developer tools
分布式资源管理与任务调度框架Yarn
解决script标签写在元素节点前面无法获取元素节点的问题
JDBC tool class
Beansearcher receives array parameters and logical deletion
Detailed comparison between graphic array and linked list, performance test
The difference between.Split (",", -1) and.Split (",")
Chapter 9.2 program control of MATLAB
Responsive layout a web page displays different effects on different devices) meta:vp
One year after graduation, I gave up the internship opportunity and taught myself software testing at home. The internship of my classmates has just ended. I have become a 12K monthly salary testing e
响应式布局一个网页在不同设备显示不同效果)meta:vp
Reconnaître le Protocole de couche de transport - TCP / UDP
1000个Okaleido Tiger首发上线Binance NFT,引发抢购热潮
5年接觸近百比特老板,身為獵頭的我,發現昇職的秘密不過4個字
認識傳輸層協議—TCP/UDP
Wenxin big model raises a new "sail", and the tide of industrial application has arrived
响应式pbootcms模板装修设计类网站