这里主要讲解如何通过调用api自动推送URL到bing站长平台,让Bing蜘蛛及时抓取你发布的内容。
随着Windows 10 Windows11 全面推广后,自带的edge浏览器也越来越流行。默认情况Windows 11的全局搜索都是用的必应,所以站长也有必要重视下Bing来的浏览了。
我们可以看看API请求结构。
首先是apiKey,apiKey是bing站长平台登陆后申请的一串字符密钥
接口请求类型:POST
接口主要参数:siteUrl urlList
成功返回:固定 "d":null
public String bingPush(String blogUrl) throws IOException {
JSONObject params=new JSONObject();
params.put("siteUrl","https://blog.xqlee.com");
params.put("urlList",Arrays.asList(blogUrl));
String apiUrl="https://ssl.bing.com/webmaster/api.svc/json/SubmitUrlbatch?apikey="+appProperties.getBingCode();
HttpResponse httpResponse = HttpSimpleClient.doPost(apiUrl, params.toJSONString(), null);
log.info("Bing Push:"+httpResponse.getResult());
return httpResponse.getResult();
}
http://blog.xqlee.com/article/981.html