当前位置:网站首页>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 .

边栏推荐
- LeetCode 70爬楼梯、199二叉树的右视图、232用栈实现队列、143重排链表
- 深入了解-微信开发者工具
- Using tessellation in unity
- 微信小程序之性能优化(分包、运行流程细节、精简结构、原生组件通信)
- [untitled]
- Graduation design campus information publishing platform website source code
- Phpcms realizes product multi condition screening function
- 原生组件、小程序与客户端通信原理、video、map、canvas、picker等运行原理
- 餐饮连锁门店重塑增长背后的数字化转型
- Study and use of windows security defect detection tool wesng
猜你喜欢

杂志特稿:元宇宙将重塑我们的生活,我们要确保它变得更好

5年接觸近百比特老板,身為獵頭的我,發現昇職的秘密不過4個字

What's new in the ranking list in July? This language is invincible?

响应式pbootcms模板装修设计类网站
![[hiflow] regularly send Tencent cloud SMS sending group](/img/af/40e4a16e4214ae2fc4781e85364a64.png)
[hiflow] regularly send Tencent cloud SMS sending group

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

Graduation design campus information publishing platform website source code

The communication principle between native components, applets and clients, and the operation principle of video, map, canvas, picker, etc

【MySQL】字符集utf8mb4无法存储表情踩坑记录

原生组件、小程序与客户端通信原理、video、map、canvas、picker等运行原理
随机推荐
What is restful
1000个Okaleido Tiger首发上线Binance NFT,引发抢购热潮
NetCore-如何保证ICollection或List私有化不被外部修改?
ACM SIGIR 2022 | interpretation of selected papers of meituan technical team
Codeworks 5 questions per day (average 1500) - day 23
Loadrunner12 installation, recording the first script and the proxy server did not respond to the solution
[untitled]
原生组件、小程序与客户端通信原理、video、map、canvas、picker等运行原理
小散量化炒股记|基于多任务爬虫技术, 实现A股实时行情Level1采样
Try to run this command from the system terminal Make sure that you use the correct
[hiflow] regularly send Tencent cloud SMS sending group
Reconnaître le Protocole de couche de transport - TCP / UDP
C - structure
2022-07-22: what is the output of the following go language code? A:1; B:1.5; C: Compilation error; D:1.49。 package main import “fmt“ func main() { var i
[untitled]
In depth understanding of the underlying framework of wechat applet (II) component system, exprser
LoadRunner12安装、录制第一个脚本以及代理服务器没有响应解决
canvas-绘图(鼠标按下 绘制 抬起 结束)
Jar package used by jsonarray in main function provided by leetcode
The combination sum of C language power deduction question 39. Backtracking method and traversal method