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
- racknerd→高配便宜 VPS $29 年 KVM 虚拟 VPS 4全球[VPS测评]
- Bootstrap-table 获取选中行数据全球[VPS测评]
- 疯狂猜成语 图猜成语海底着火是什么成语?全球[VPS测评]
- .htaccess 设置整站所有链接 301 重定向全球[VPS测评]
- 腾讯云秒杀→1499 元 3 年-双核 4G 内存 50G 硬盘 6M 全球[VPS测评]
- 阿里云服务器 9 月 2 折 2 核 8G 5M 独享 不限流量 300全球[VPS测评]
- tmhhost 香港 cn2 多线 bgp 服务器 400 元 月起,4香港VPS[主机]
- 一般-onevps 新增美国洛杉矶 KVM VPS 服务器,提供首月 5美国VPS[主机]
- DediPath 美国 G 口无限流量 VPS 速度及综合性能测评,便宜美国VPS[主机]
- PacificRack→$7.25 年 KVM-512MB 10GB 5全球[VPS测评]
- CloudIPLC 泉州电信CN2 大带宽出国优质线路 ¥560起/月全球[VPS测评]
- 六六云洛杉矶cera VPS 云服务器 三网联通CUVIP/1Gbps带全球[VPS测评]
- WordPress网站搜索结果只有一篇文章代码实现自动跳转到该文章全球[VPS测评]
- 咖啡主机元旦洛杉矶高防/香港将军澳VPS八折优惠,月付16元起香港VPS[主机]
- 2022年开源 WordPress 免费主题推荐全球[VPS测评]
- 8K超高清记录中国空间站凌月:天和核心舱与问天实验舱组成“土”字结构虚拟空间(主机)
- wikihost,微基主机:1核/1G/15G/100Mbps/香港vp香港VPS[主机]
- Mysql连接数过高,如何检查?全球[VPS测评]
- 快速云:云服务器和vps区别是什么云服务器和vps哪个比较安全2022-全球[VPS测评]
- 冀青云怎么样?香港CN2-GIA vps月28元/香港NTT 月9元香港VPS[主机]
- 兼容移动和PC的loading加载和toast消息插件全球[VPS测评]
- UCloud促销:快杰云主机52元/年起,可选台湾(台北)/香港/北京/香港VPS[主机]
- edgenat:韩国cn2+香港cn2,VPS八折优惠,8核8G/50gWINDOWS
- 谷歌浏览器网址如何显示http,www,Chrome谷歌浏览器恢复地址栏全球[VPS测评]
- SugarHosts糖果主机:虚拟主机5折(有独立IP);香港/美国cn独立服务器[U]
- CombCloud,香港沙田CN2VPS测评,2核1G52元/月,安畅C香港VPS[主机]
- 快速云:云服务器vps的区别是什么云服务器和vps哪个比较好2022-0全球[VPS测评]
- 蓝米云:美国cera vps/香港cn2vps套餐,1核2G/40G/1美国VPS[主机]
- 悠久云:香港云服务器低至9.9元/月;香港大带宽vps,4核4G30M仅香港VPS[主机]
- 绮风云:香港云服务器低至9.9元/月起,深圳/北京/内蒙古vps,63.香港VPS[主机]
转载请注明原文地址:https://motoll.com/read-242893.html