欧路云:香港/加拿大/法国/新加坡vps全线产品8折优惠,适用于新购/续费/升级
【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |
首先如何获取必应的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
- 做站首选 腾讯云服务器秒杀活动→上海机房 2G 内存 VPS 年付 19全球[VPS测评]
- tmhhost→安畅机房 cn2 gia vps 促销 强制三网回程 c全球[VPS测评]
- servaRICA→$7 月 4 核 6GB 内存 80GB NVMe 虚拟空间(主机)
- RackNerd 洛杉矶新机房上线,Sharktech 数据中心,60G全球[VPS测评]
- 疯狂猜成语 图猜成语一匹马奔向成功是什么成语?全球[VPS测评]
- 疯狂猜成语 图猜成语前面一个人拿着刀在跑后面一个人站着中间有个坑是什么成全球[VPS测评]
- bacloud→€33.33 月 e3-1230v2 8G 内存 2*1全球[VPS测评]
- iWFHosting→$8.99 月 KVM-2GB 25GB 1.5T全球[VPS测评]
- 便宜 VPS $9 年 512M 内存 10G SSD 250G 流量 全球[VPS测评]
- bacloud→€33.33 月 e3-1230v2 8G 内存 2*1全球[VPS测评]
- WordPress网站上传图片出现http报错解决办法全球[VPS测评]
- WordPress基于WPJAM BASIC开发的免费主题:Honey主全球[VPS测评]
- 百度搜索将打击网站搜索内容需获取权限才能查看的情况全球[VPS测评]
- 书单推荐:《清单革命-不犯错的秘密武器》和《从汉城到燕京-朝鲜使者眼中的全球[VPS测评]
- Google Voice 自动回复短信保号一键脚本,防止谷歌收回全球[VPS测评]
- 1FIRE 德国 2.95欧 1G无限流量VPS测评 解锁Netflix全球[VPS测评]
- 跨境电商平台首选香港服务器香港VPS[主机]
- 自适应bootstrap左侧导航可关闭全球[VPS测评]
- 什么是云服务器?云服务器怎么登陆?全球[VPS测评]
- 147SEO采集器 CSS选择器写法案例全球[VPS测评]
- 快速云:云计算分类和云计算的特点全球[VPS测评]
- 跨境电商有哪些平台?十大跨境电商平台!全球[VPS测评]
- 麻花云双12年终盛典:香港云主机9元起,老客户续费6折;安徽BGP线路v香港VPS[主机]
- 文物、沉船、村落!干旱导致大量遗迹重见天日 2022年干旱还要持续多久?全球[VPS测评]
- 为什么要拥有一台VPS?全球[VPS测评]
- 触摸云:喜迎新春回馈活动_香港/美国VPS全场特惠价85折起_续费同价!美国VPS[主机]
- 群英云:新年促销活动,海外云服务器9.9元起,高防云服务器135元全球[VPS测评]
- LOCVPS,全新香港大浦CN2 VPS 2核4G内存3M仅54/月香港VPS[主机]
- 云服务器能干什么?有几十种玩法?阿里云,腾讯云服务器如何购买?全球[VPS测评]
- hosthatch:香港/芝加哥/伦敦等11机房VPS低至$17.5/年香港VPS[主机]
转载请注明原文地址:https://www.motoll.com/read-249614.html