易探云:独立IP香港云服务器租用,香港vps海外云主机BGP线路/CN2高防
【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |
首先如何获取必应的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 PacificRack→$9.99 每年 1 核 CPU 全球[VPS测评]
- Debian 系统不能使用 dig 和 nslookup 的解决办法全球[VPS测评]
- RAKsmart→美国站群买一送一 I3 低至$46 抢购 VPS 年付站群服务器[IP]
- Laravel 安装过程报错 PHP extension mcrypt 全球[VPS测评]
- MySql 多个关键字 like 查询结果按照匹配最多排序全球[VPS测评]
- 香港 VPS 14 元起 美国 CERA VPS 18.8 元 月 咖啡美国VPS[主机]
- 教程 2019 年 namesilo 域名转入 name.com 最新图全球[VPS测评]
- 企鹅小屋→550 元 月 E5-26XX 16GB 内存 600GB 硬日本VPS[主机]
- 两个得字下面一个大的举字是什么成语?全球[VPS测评]
- 优惠 ¥56 月 2 核 4G 内存 40G SSD 5Mbps 不限流香港VPS[主机]
- 1美元的便宜 VPS 推荐全球[VPS测评]
- ElixirNode → $2 月 1C1G25G硬盘 美国 加拿大 法美国VPS[主机]
- Evoxt 英国服务器测试 2.99$月付 1Gbps 解锁流媒体全球[VPS测评]
- DMIT.io → 2G 内存 20G SSD 无限流量 200M带宽 全球[VPS测评]
- Cloudcone → 512M 10G SSD 1T $2.22月付全球[VPS测评]
- GreenCloudVPS → 美国欧洲存储型 → 2G 500G 美国VPS[主机]
- on9host 1核心 512M内存 15G 储存 500G流量 30M全球[VPS测评]
- 原创解析:云计算含义及定义全球[VPS测评]
- CentOS 7.x 系统安装和配置redis-7.0.4集群全球[VPS测评]
- uuuvps:香港VPS低至97元/年,CN2+bgp网络,香港机房VP香港VPS[主机]
- 翔云网络怎么样?香港云服务器优惠99/月,国内4核4G高防服务器6800香港VPS[主机]
- 数字化东风已来,亚马逊云科技跨境电商合作企业招募大会即将开启全球[VPS测评]
- 适合美容院的正能量抖音文案,唯美阳光,正能量满满全球[VPS测评]
- 亿速云双12年终回馈:云服务器2折活动,订单满100元减50元全球[VPS测评]
- HostXen:双十一新用户香港、日本vps,送20元代金券,充值300日本VPS[主机]
- 无忧云:雅安/德阳100G高防云主机月付78元起,香港CN2云服务器月付香港VPS[主机]
- 云服务器都是有哪些特点?全球[VPS测评]
- 创意加载进度HTML动画特效,SVG+CSS3实现的动画死神来了load全球[VPS测评]
- 野草云服务器怎么样?香港CN2+BGP带宽30M月付19元香港VPS[主机]
- 狸猫云:香港高速CN2VPS,200元/年-香港高速GIA云服务器促销活香港VPS[主机]
转载请注明原文地址:http://www.motoll.com/read-250935.html