acroservers:香港/日本/新加坡/洛杉矶等37个机房可选,海外vps价格低至€4.5/月
![]() | ![]() | ![]() | ![]() |
| 【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
| 【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |

首先如何获取必应的api密钥
直接上代码,复制保存为post.php,然后通过宝塔面板的计划任务添加即可。
<?php$arr = array( 'https://www.esphp.com.com' => array( 'url' => array( "https://www.esphp.com/sitemap.xml" ), 'bing_key' => "303c2be9581c432da0f65c6b2fa1b416" ),);foreach ($arr as $i => $j) { //网站地址 $website = $i; //站点地图 $url = $j['url']; //必应key $bing_key = $j['bing_key']; //配额接口调用地址 $quota_api = "https://ssl.bing.com/webmaster/api.svc/json/GetUrlSubmissionQuota?siteUrl=$website&apikey=$bing_key"; //URL提交API接口调用地址 $seturl_api = "https://ssl.bing.com/webmaster/api.svc/json/SubmitUrlBatch?apikey=$bing_key"; $s = file_get_contents($quota_api); $s = json_decode($s, true); echo "$website 必应今日剩余配额:".$s['d']['DailyQuota']." 本月剩余配额:".$s['d']['MonthlyQuota'];echo '<br>'; if($s['d']['DailyQuota']){ $ch = curl_init(); //防https错误 $xmlresponse = curl_exec($ch); $xml=simplexml_load_string($xmlresponse); $urls = array(); foreach ($url as $key => $value) { curl_setopt($ch, CURLOPT_URL, $value); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $xmlresponse = curl_exec($ch); $xml=simplexml_load_string($xmlresponse); foreach ($xml as $key => $value) { $urls[] = $value->loc; } } shuffle($urls); //必应api提交每次上限100条 if ($s['d']['DailyQuota']>=100) { $max = 100; } else { $max = $s['d']['DailyQuota']; } $urls = array_slice($urls, 0,$s['d']['DailyQuota']); if(!$urls){ echo $website.' 今日配额已全部提交!';continue; } $url_data = array_chunk($urls, $max, true); foreach ($url_data as $key => $value) { $url_str = implode(',',$value); $url_arr = explode(',',$url_str); $data = array( "siteUrl"=>$website, "urlList"=>$url_arr ); $ch = curl_init(); $options = array( CURLOPT_URL => $seturl_api, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => json_encode($data), CURLOPT_HTTPHEADER => array('Content-Type: application/json'), ); curl_setopt_array($ch, $options); $result = curl_exec($ch); echo "$website 必应提交信息:".$result;echo '<br>'; } }}?>将必应提供的key和站点地图修改为自己的即可
[主机测评]历史优惠活动内容
猜你可能想看的VPS
- 在 Ubuntu 系统下安装最新稳定版 qBittorrent全球[VPS测评]
- 企鹅小屋→300 元 月 256MB 内存 10GB SSD 空间 10虚拟空间(主机)
- php 判断数组中是否存在指定键(key)的两种方法全球[VPS测评]
- 笑字中间有一把刀是什么成语?全球[VPS测评]
- HostYun→9.9 元 月 512MB 内存 5GB SSD 空间 虚拟空间(主机)
- WordPress文章发布时间怎么精确到秒?全球[VPS测评]
- WordPress搜索插件:Ivory Search全球[VPS测评]
- WordPress 修改管理页面登录地址全球[VPS测评]
- 日本VPS服务器商家收集汇总 方便购买日本VPS服务器日本VPS[主机]
- 基于CentOS系统的VPS安全设置与优化全球[VPS测评]
- CloudCone黑五闪购,每小时都有惊喜,超低价值得期待全球[VPS测评]
- Wikihost(idc.wiki) → 香港沙田Gen2 大宽带大流香港VPS[主机]
- ConoHa 新加坡小鸡评测 不能看 Netflix全球[VPS测评]
- ERP库存管理系统HTML5模板 - DreamsPOS全球[VPS测评]
- SEO和网页加载速度有关系吗?如何提升?全球[VPS测评]
- 轻云互联,香港VPS月付22元 美国VPS月付19元美国VPS[主机]
- 金斗云怎么样?香港CN2月付23元,圣何塞CN2月付22元香港VPS[主机]
- 快速云:云计算分类和云计算的特点全球[VPS测评]
- CombCloud,香港沙田cn2vps终身七折起,高质量网络稳定低延迟香港VPS[主机]
- 跨境电商拔节生长关键期,宁波政协委员月谈会精准助力!全球[VPS测评]
- 老六云怎么样?香港cn2vps月付23元香港NTT月付9.9元香港VPS[主机]
- 互盟云怎么样?1核2G云服务器仅468元/年,香港云主机58元/月香港VPS[主机]
- BBR对比BBR2BBRPLUSBBR2CAKE锐速哪个效果好全球[VPS测评]
- 消费复苏形势良好,我们将多措并举实施扩大内需政策全球[VPS测评]
- 全球云lovps,香港CN2线路vps 新品七折月付49元香港VPS[主机]
- 傲游主机:香港cn2高防云主机,159元/月/2核/2GB/40GB/2香港VPS[主机]
- 网站迁移服务器是如何运作的?新手站长看完这篇文章,很容易就能看完。全球[VPS测评]
- 百看不厌的文案,抖音唯美文案。全球[VPS测评]
- cloudpowerall:美国洛杉矶CN2 VPS,年付$9.99;香美国VPS[主机]
- 悠久云:香港云服务器低至9.9元/月;香港大带宽vps,4核4G30M仅香港VPS[主机]
转载请注明原文地址:http://140.238.13.167:12355/read-242893.html











