野草云:2021开年大促 – 香港VPS 136.8元年起;香港服务器350元月
【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |
首先如何获取必应的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
- 疯狂猜成语 图猜成语一个人站在起点和终点之间是什么成语?全球[VPS测评]
- 特价补货 tmhhost→512M 1 核 20G 0.5T 流量 季付全球[VPS测评]
- 腾讯云→“2019 年 12 月”云服务器秒杀活动 最新腾讯云优惠信息 香港VPS[主机]
- FDCServers→$1999 月 2*E5-2650 128GB 内日本VPS[主机]
- Digital-vm→$2.8 月 KVM-512MB 30G SSD 日本VPS[主机]
- 宝塔面板回收站位置 宝塔面板回收站在哪里全球[VPS测评]
- 特价 标准互联→洛杉矶 CN2 GT 线路套餐年付 240 元 BGP 全球[VPS测评]
- linux 删除文件夹命令全球[VPS测评]
- TmhHost→安畅机房 CN2 GIA 线路补货 新上韩国 CN2 线韩国VPS[主机]
- 新加坡绕-WINNERvps→$3.99 月 1GB 内存 25GB S虚拟空间(主机)
- 腾讯云 - 11.11 智惠上云提前购 双十一同价 2C4G5M 三年 全球[VPS测评]
- EDIS→€9.59 月 1GB 内存 15GB SSD 空间 250G虚拟空间(主机)
- thinkphp5 控制器怎么返回 json 格式数据?全球[VPS测评]
- 华为云 开年采购季,新用户享 1 核 2G 云服务器 79 元 年,消费全球[VPS测评]
- 特价 标准互联→洛杉矶 CN2 GT 线路套餐年付 240 元 BGP 全球[VPS测评]
- myhbd-4.99欧月付起 1GB内存20GB硬盘 不限流量 1Gbp全球[VPS测评]
- HostHatch 大容量VPS 1G 1T HDD 2T $5 月全球[VPS测评]
- HostDoc 1核心 3G内存 30G SSD 60G HDD 1T流美国VPS[主机]
- 持续高温!长沙所有初中新生停止军训!全球[VPS测评]
- 美国信贷市场的痛苦将不亚于上世纪70年代的通胀时期美国VPS[主机]
- wordpress 上传附件报错 “抱歉,出于安全的考虑,不支持此文件类全球[VPS测评]
- 桔子数据怎么样?便宜香港安畅CN2 VPS1核1G10M 28/月香港VPS[主机]
- 众创逸云:国庆中秋节大促销优惠,不限流量香港CN2线路VPS 5.9元/香港VPS[主机]
- 2020畅行云双11活动:海内外云服务器超低1.5折,2核2G5M云主机全球[VPS测评]
- 恒星云:香港沙田CN2VPS低至9.9元/起_国内BGP云服务器4核4G香港VPS[主机]
- 雪花云怎么样?雪花云香港云服务器1核1G2M仅19元/月香港VPS[主机]
- UOVZ怎么样?香港30M大带宽VPS 直连线路月付50元香港VPS[主机]
- 为什么要拥有一台VPS?全球[VPS测评]
- 野草云vps怎么样?香港美国vps,1核1G3M带宽,38元/月美国VPS[主机]
- 青果云:香港云主机2核1G3M30G,香港vps仅售59元/月香港VPS[主机]
转载请注明原文地址:https://motoll.com/read-247160.html