傲游主机:香港cn2高防云主机,159元/月/2核/2GB/40GB/200GB流量/DDOS/KVM
【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |
首先如何获取必应的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
- 9s9s→大带宽洛杉矶 CN2 GIA VPS 圣何塞不限流量 VPS 全球[VPS测评]
- 四个实线写的大字是什么成语?全球[VPS测评]
- tmhhost→安畅机房 cn2 gia vps 促销 强制三网回程 c全球[VPS测评]
- [11.11]阿里云国内云服务器年付 86 元三年 229 元 香港云服香港VPS[主机]
- ABCloud→45 元 月 512MB 内存 5GB SSD 空间 1虚拟空间(主机)
- 疯狂猜成语 图猜成语一只老虎和一只狐狸站在一起是什么成语?全球[VPS测评]
- RAKsmart→圣何塞 G 口不限服务器低至每月 199 美元 买 1全球[VPS测评]
- 阿里云 2020 年 1 月促销:国内 香港云服务器 2 核 8G5M1香港VPS[主机]
- 2020 年整理抗投诉 VPS 和服务器(无视版权 DMCA FREE)全球[VPS测评]
- Laravel 报错 Call to undefined functio全球[VPS测评]
- 数脉科技→香港独立服务器低至 360 元 月 E3-1230v2 16g独立服务器[U]
- 预售 ¥399 月 L5630*2 16G 内存 1TB 硬盘 100M全球[VPS测评]
- 恒创科技 新用户优惠 香港CN2 GIA线路 1G内存 50g硬盘 2M香港VPS[主机]
- CentOS/Fedora/Ubuntu/Debian 一键安装 wge全球[VPS测评]
- PacificRack元旦 便宜美国VPS/4G内存/10T大流量 年付美国VPS[主机]
- edgenat韩国CN2独立服务器促销,原生IP,月付七折,年付买一年送独立服务器[U]
- 腾讯云岁末回馈老用户免费体验CDN,轻量应用服务器或者云存储一个月全球[VPS测评]
- Littlecreek hosting → 美东 北卡罗纳州 1核1G2全球[VPS测评]
- Olvps → 256M内存 5G 储存 512G流量 30Mbps 全球[VPS测评]
- Fatal error: Allowed memory size of 全球[VPS测评]
- 关键路径、资金情况、政策关键数据中心的可持续发展路径在哪里?全球[VPS测评]
- Fatal error: Allowed memory size of 全球[VPS测评]
- Bloggar-移动端友好的新闻博客类HTML5模板全球[VPS测评]
- 阿里云香港服务器多少钱一年?阿里云香港云服务器如何购买?香港VPS[主机]
- 后浪云:优惠码”2021″,美国/香港2核4G2M云服务器仅32.5元/美国VPS[主机]
- 为什么阿里云、腾讯云卖服务器可以挣到钱?全球[VPS测评]
- 宝塔面板在香港服务器安装启动不了nginx怎么办?香港VPS[主机]
- 初忆云:香港美国cn2云服务器30元;香港cn2高防vps30元,美国1美国VPS[主机]
- 无忧云:香港大埔/荃湾云服务器5折优惠,可叠加优惠码,国内高防78元起香港VPS[主机]
- Vmshell:香港vps调整,流量提升至500GB/月,带宽200MB香港VPS[主机]
转载请注明原文地址:http://www.motoll.com/read-240569.html