阁天互联怎么样?香港cn2云服务器 圣何塞cn2vps仅20/月
【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |
首先如何获取必应的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
- HKServerSolution→499 元 季 2G 内存 15GB 虚拟空间(主机)
- veesp→$1 月 KVM-512MB 10GB 100GB 圣彼得堡全球[VPS测评]
- notepad++设置中文 notepad++如何设置简体中文界面全球[VPS测评]
- PHP 保留两位小数(不四舍五入)全球[VPS测评]
- php 随机生成字符串的函数全球[VPS测评]
- hostigger 四月特惠!伊斯坦布尔 阿姆斯特丹 堪萨斯城 VPS 全球[VPS测评]
- 阿里云双 11 返场→企业认证用户 2 核 8G5M 云服务器 1140全球[VPS测评]
- PacificRack→$9.99 年 KVM-1GB 13GB 2TB全球[VPS测评]
- FlashFXP 错误 530 Login incorrect 解决方法全球[VPS测评]
- OLVPS→端口转发 100GB 流量 月付 20 元;枣庄联通独服 3全球[VPS测评]
- GinerNet→€19.99 月 4GB 内存 50GB NVMe 空虚拟空间(主机)
- HostYun→17 元 月 KVM-512MB 10GB 500GB 全球[VPS测评]
- 优化YSlow add expires headers项目提升博客访问速全球[VPS测评]
- vietvps → 5.4$ 月 越南 1C1G30G硬盘 1Gbps无全球[VPS测评]
- SPIDYHOST → 5.7$ 月 1C1G25G硬盘 1T流量 印度美国VPS[主机]
- Debian 9 Stretch 安全升级到 Debian 10 Bus全球[VPS测评]
- 向日葵-漏洞科普:海外云服务器三种漏洞修复方法快收藏起来!全球[VPS测评]
- 网站迁移服务器是如何运作的?新手站长看完这篇文章,很容易就能看完。全球[VPS测评]
- 阿里云服务器一年价格多少钱?阿里云服务器报价全球[VPS测评]
- 桔子数据:1核1GB香港CN2 GIA vps促销28元/月,最高30M香港VPS[主机]
- 香港云服务器的优势有哪些方面香港VPS[主机]
- cmivps:香港vps终身7折,香港服务器终身9折,移动访问尤其优秀香港VPS[主机]
- 56云服务器怎么样?56云服务器价格和优势是什么?全球[VPS测评]
- 磐逸云:深圳/大连/成都/香港机房vps,1核1G3M仅26元/月,65香港VPS[主机]
- 雪花云怎么样?雪花云香港云服务器1核1G2M仅19元/月香港VPS[主机]
- 六一云:香港CN2/洛杉矶高防85折优惠,CDN半年优惠,充值返利送水杯香港VPS[主机]
- ExCloud:1核256M存/8GB SSD空间/100GB流量/OV虚拟空间(主机)
- btcvps,比特云怎么样?香港VPS,KVM架构带宽4M月付88港币香港VPS[主机]
- 华纳云新春活动:香港CN2云服务器4核4G5M仅3476元/3年;美国云美国VPS[主机]
- 2020年国外VPS哪个最好?教你学会选择国外VPS全球[VPS测评]
转载请注明原文地址:https://www.motoll.com/read-233649.html