Java检测百度是否收录网站url、推送百度的工具类

import com.alibaba.fastjson.JSONObject;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URL;
import java.net.URLConnection;

public class BaiduEmbodyTool {
	public static Boolean check(String ---) {
		try {
			Connection.Response ---- = Jsoup.connect("https://www.baidu.com/s?wd=" + ---)
				.timeout(60000)
				.method(Connection.Method.GET)
				.maxBodySize(0)
				.followRedirects(false)
				.execute();
			String ---- = new String(----.bodyAsBytes());
			if( !"".equals(----) ){
				Document --- = Jsoup.parse(----);
				Element ------- = ---.getElementsByClass("content_none").first();
				return null == -------;
			}else{
				return false;
			}
		} catch (Exception -) {
			-.printStackTrace();
			return false;
		}
	}
	public static JSONObject publish(String ----, String -----, String[] ----){
		String ----- = "";
		for(String - : ----){
			----- += - + "\n";
		}
		PrintWriter --- = null;
		BufferedReader -- = null;
		String ------ = "";
		try {
			URLConnection ---- = new URL("http://data.zz.baidu.com/urls?site=" + ---- + "&token=" + -----).openConnection();
			----.setRequestProperty("Host", "data.zz.baidu.com");
			----.setRequestProperty("User-Agent", "curl/7.12.1");
			----.setRequestProperty("Content-Type", "text/plain");
			----.setDoInput(true);
			----.setDoOutput(true);
			--- = new PrintWriter(----.getOutputStream());
			---.print(-----.trim());
			---.flush();
			-- = new BufferedReader(new InputStreamReader(----.getInputStream()));
			String ----;
			while ((---- = --.readLine()) != null) {
				------ += ----;
			}
			return JSONObject.parseObject(------);
		} catch (Exception -) {
			-.printStackTrace();
			return null;
		} finally {
			if(---!=null){
				try {
					---.close();
				}catch (Exception -){
					-.printStackTrace();
				}
			}
			if(--!=null){
				try {
					--.close();
				}catch (Exception -){
					-.printStackTrace();
				}
			}
		}
	}
}
生前何必久睡,死后定会长眠。