💬 添加注释
This commit is contained in:
parent
8e32243ae4
commit
2ce6c5f9e7
@ -33,6 +33,29 @@ public class BaiDuUtils {
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
},executor);
|
},executor);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendUpdateSEOData(String permalink) {
|
||||||
|
if (StringUtils.isBlank(permalink) || StringUtils.isBlank(token)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ExecutorService executor= new ThreadPoolExecutor(1,1,0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
|
||||||
|
CompletableFuture.supplyAsync(()-> {
|
||||||
|
try {
|
||||||
|
HttpResponse response = HttpRequest.post("http://data.zz.baidu.com/update?site=" + site + "&token=" + token).
|
||||||
|
header("User-Agent", "curl/7.12.1").
|
||||||
|
header("Host", "data.zz.baidu.com").
|
||||||
|
header("Content-Type", "text/plain").
|
||||||
|
header("Connection", "close").body(permalink.getBytes(), "text/plain").timeout(30000).send();
|
||||||
|
response.charset("UTF-8");
|
||||||
|
System.out.println(response.bodyText());
|
||||||
|
} catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
},executor);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateSEOData(String permalink) {
|
public static void updateSEOData(String permalink) {
|
||||||
@ -78,6 +101,6 @@ public class BaiDuUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args){
|
public static void main(String[] args){
|
||||||
sendSEOData("https://rymcu.com");
|
sendUpdateSEOData("https://rymcu.com");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user