├── script ├── start.bat └── start.sh ├── doc └── image │ ├── indexing_tools.gif │ ├── 27c3ec0b22684032a66ccaf2f6dd9b22.png │ └── 3fca3b7e7fda4a9b808b6858cd6c2074.jpg ├── src └── main │ └── java │ └── net │ └── renfei │ └── indexing │ ├── entity │ ├── GoogleIndexingEntity.java │ └── ConfigVO.java │ ├── Application.java │ ├── service │ ├── CheckVersionService.java │ ├── ConfigFileService.java │ ├── BingService.java │ ├── BaiduService.java │ ├── QiHu360Service.java │ ├── GoogleService.java │ ├── ExtractSitemapService.java │ └── ExecService.java │ └── ui │ ├── MenuBar.java │ ├── MainWindow.java │ └── MainWindow.form ├── README.md ├── pom.xml └── LICENSE /script/start.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renfei/Indexing/HEAD/script/start.bat -------------------------------------------------------------------------------- /doc/image/indexing_tools.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renfei/Indexing/HEAD/doc/image/indexing_tools.gif -------------------------------------------------------------------------------- /doc/image/27c3ec0b22684032a66ccaf2f6dd9b22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renfei/Indexing/HEAD/doc/image/27c3ec0b22684032a66ccaf2f6dd9b22.png -------------------------------------------------------------------------------- /doc/image/3fca3b7e7fda4a9b808b6858cd6c2074.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renfei/Indexing/HEAD/doc/image/3fca3b7e7fda4a9b808b6858cd6c2074.jpg -------------------------------------------------------------------------------- /src/main/java/net/renfei/indexing/entity/GoogleIndexingEntity.java: -------------------------------------------------------------------------------- 1 | package net.renfei.indexing.entity; 2 | 3 | public class GoogleIndexingEntity { 4 | private String url; 5 | private String type; 6 | 7 | public String getUrl() { 8 | return url; 9 | } 10 | 11 | public void setUrl(String url) { 12 | this.url = url; 13 | } 14 | 15 | public String getType() { 16 | return type; 17 | } 18 | 19 | public void setType(String type) { 20 | this.type = type; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /script/start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "###################################" 3 | echo "# --=== Indexing ===-- #" 4 | echo "# author: renfei (i@renfei.net) #" 5 | echo "###################################" 6 | DIR_NAME=$0 7 | if [ "${DIR_NAME:0:1}" = "/" ];then 8 | # shellcheck disable=SC2006 9 | DIR_PATH=`dirname "$DIR_NAME"` 10 | else 11 | # shellcheck disable=SC2006 12 | # shellcheck disable=SC2123 13 | DIR_PATH="`pwd`"/"`dirname "$DIR_NAME"`" 14 | fi 15 | nohup "$DIR_PATH"/bin/java -jar "$DIR_PATH"/Indexing/Indexing.jar > "$DIR_PATH"/Indexing/Indexing.log 2>&1 & echo $! > "$DIR_PATH"/Indexing/Indexing.pid -------------------------------------------------------------------------------- /src/main/java/net/renfei/indexing/Application.java: -------------------------------------------------------------------------------- 1 | package net.renfei.indexing; 2 | 3 | import net.renfei.indexing.ui.MainWindow; 4 | import net.renfei.indexing.ui.MenuBar; 5 | 6 | import javax.swing.*; 7 | 8 | 9 | /** 10 | * 程序入口 11 | * 12 | * @author renfei 13 | */ 14 | public class Application { 15 | public static final MainWindow MAIN_WINDOW = new MainWindow(); 16 | public static final String VERSION = "1.0.4"; 17 | public static void main(String[] args) { 18 | javax.swing.JFrame frame = new javax.swing.JFrame("Indexing - 搜索引擎推送工具 - SEO 工具箱"); 19 | frame.setContentPane(MAIN_WINDOW.mainPanel); 20 | frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); 21 | frame.pack(); 22 | frame.setSize(1000, 718); 23 | frame.setLocationRelativeTo(null); 24 | frame.setJMenuBar(new MenuBar()); 25 | MAIN_WINDOW.init(); 26 | frame.setVisible(true); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/net/renfei/indexing/entity/ConfigVO.java: -------------------------------------------------------------------------------- 1 | package net.renfei.indexing.entity; 2 | 3 | /** 4 | * @author renfei 5 | */ 6 | public class ConfigVO { 7 | private String siteUrl; 8 | private String baiduToken; 9 | private String bingToken; 10 | private String googleJsonPath; 11 | private String soToken; 12 | 13 | public String getSiteUrl() { 14 | return siteUrl == null ? "" : siteUrl; 15 | } 16 | 17 | public void setSiteUrl(String siteUrl) { 18 | this.siteUrl = siteUrl; 19 | } 20 | 21 | public String getBaiduToken() { 22 | return baiduToken == null ? "" : baiduToken; 23 | } 24 | 25 | public void setBaiduToken(String baiduToken) { 26 | this.baiduToken = baiduToken; 27 | } 28 | 29 | public String getBingToken() { 30 | return bingToken == null ? "" : bingToken; 31 | } 32 | 33 | public void setBingToken(String bingToken) { 34 | this.bingToken = bingToken; 35 | } 36 | 37 | public String getGoogleJsonPath() { 38 | return googleJsonPath == null ? "" : googleJsonPath; 39 | } 40 | 41 | public void setGoogleJsonPath(String googleJsonPath) { 42 | this.googleJsonPath = googleJsonPath; 43 | } 44 | 45 | public String getSoToken() { 46 | return soToken == null ? "" : soToken; 47 | } 48 | 49 | public void setSoToken(String soToken) { 50 | this.soToken = soToken; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/net/renfei/indexing/service/CheckVersionService.java: -------------------------------------------------------------------------------- 1 | package net.renfei.indexing.service; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import net.renfei.indexing.Application; 5 | import net.renfei.sdk.http.HttpRequest; 6 | import net.renfei.sdk.http.HttpResult; 7 | import net.renfei.sdk.utils.HttpUtils; 8 | 9 | import javax.swing.*; 10 | import java.io.IOException; 11 | import java.net.URI; 12 | import java.net.URISyntaxException; 13 | 14 | import static net.renfei.indexing.ui.MenuBar.openURL; 15 | 16 | /** 17 | * 检查新版本服务 18 | * 19 | * @author renfei 20 | */ 21 | public class CheckVersionService { 22 | public static void checkVersion() { 23 | HttpRequest request = HttpRequest.create().url("https://gitee.com/api/v5/repos/rnf/Indexing/releases/latest").useSSL(); 24 | try { 25 | HttpResult result = HttpUtils.get(request); 26 | String responseText = result.getResponseText(); 27 | String latestTagName = JSON.parseObject(responseText).getString("tag_name"); 28 | if (Application.VERSION.equals(latestTagName)) { 29 | JOptionPane.showMessageDialog(Application.MAIN_WINDOW.mainPanel, 30 | "您当前使用的就是最新版。", "检查更新", JOptionPane.PLAIN_MESSAGE); 31 | } else { 32 | int resultInt = JOptionPane.showConfirmDialog(Application.MAIN_WINDOW.mainPanel, 33 | "发现新版本:" + latestTagName + ",是否前往下载?", "检查更新", JOptionPane.YES_NO_OPTION); 34 | if (resultInt == 0) { 35 | openURL(new URI("https://gitee.com/rnf/Indexing/releases")); 36 | } 37 | } 38 | } catch (IOException | URISyntaxException e) { 39 | e.printStackTrace(); 40 | JOptionPane.showMessageDialog(Application.MAIN_WINDOW.mainPanel, 41 | "检查失败,请手动前往「https://www.renfei.net/kitbox/indexing」检查。", "检查更新", JOptionPane.PLAIN_MESSAGE); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/net/renfei/indexing/service/ConfigFileService.java: -------------------------------------------------------------------------------- 1 | package net.renfei.indexing.service; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import net.renfei.indexing.entity.ConfigVO; 5 | 6 | import javax.swing.filechooser.FileSystemView; 7 | import java.io.*; 8 | import java.nio.charset.StandardCharsets; 9 | 10 | /** 11 | * 配置文件服务 12 | * 13 | * @author renfei 14 | */ 15 | public class ConfigFileService { 16 | public static ConfigVO getConfig() { 17 | File file = getConfigFile(); 18 | if (file != null) { 19 | try (FileInputStream inputStream = new FileInputStream(file)) { 20 | int length = inputStream.available(); 21 | byte[] bytes = new byte[length]; 22 | inputStream.read(bytes); 23 | String str = new String(bytes, StandardCharsets.UTF_8); 24 | return JSON.parseObject(str, ConfigVO.class); 25 | } catch (Exception e) { 26 | e.printStackTrace(); 27 | return null; 28 | } 29 | } 30 | return null; 31 | } 32 | 33 | public static void saveConfig(ConfigVO configVO) { 34 | File file = getConfigFile(); 35 | if (file != null && configVO != null) { 36 | PrintStream stream = null; 37 | try { 38 | stream = new PrintStream(file); 39 | stream.print(JSON.toJSONString(configVO)); 40 | stream.close(); 41 | } catch (Exception e) { 42 | e.printStackTrace(); 43 | } 44 | } 45 | } 46 | 47 | public static void deleteConfig() { 48 | File file = getConfigFile(); 49 | if (file != null) { 50 | file.delete(); 51 | } 52 | } 53 | 54 | private static File getConfigFile() { 55 | FileSystemView fsv = FileSystemView.getFileSystemView(); 56 | File file = new File(fsv.getHomeDirectory().getPath() + "/Indexing.conf"); 57 | if (!file.exists()) { 58 | try { 59 | file.createNewFile(); 60 | } catch (IOException e) { 61 | e.printStackTrace(); 62 | return null; 63 | } 64 | } 65 | return file; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/net/renfei/indexing/service/BingService.java: -------------------------------------------------------------------------------- 1 | package net.renfei.indexing.service; 2 | 3 | import org.apache.http.HttpEntity; 4 | import org.apache.http.HttpStatus; 5 | import org.apache.http.client.config.RequestConfig; 6 | import org.apache.http.client.methods.CloseableHttpResponse; 7 | import org.apache.http.client.methods.HttpPost; 8 | import org.apache.http.entity.ContentType; 9 | import org.apache.http.entity.StringEntity; 10 | import org.apache.http.impl.client.CloseableHttpClient; 11 | import org.apache.http.impl.client.HttpClients; 12 | import org.apache.http.util.EntityUtils; 13 | 14 | import java.io.IOException; 15 | 16 | public class BingService { 17 | private final String siteUrl; 18 | private final String bingToken; 19 | 20 | public BingService(String siteUrl, String bingToken) { 21 | this.siteUrl = siteUrl; 22 | this.bingToken = bingToken; 23 | } 24 | 25 | public String push(String url) throws IOException { 26 | String pushUrl = "https://ssl.bing.com/webmaster/api.svc/json/SubmitUrlbatch?apikey=" + bingToken; 27 | String json = "{\"siteUrl\":\"" + siteUrl + "\",\"urlList\":[\"" + url + "\"]}"; 28 | CloseableHttpClient closeableHttpClient = HttpClients.createDefault(); 29 | CloseableHttpResponse closeableHttpResponse; 30 | HttpPost httpPost = new HttpPost(pushUrl); 31 | httpPost.addHeader("Content-Type", "application/json"); 32 | StringEntity entity = new StringEntity(json, ContentType.create("application/json", "UTF-8")); 33 | httpPost.setEntity(entity); 34 | RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(5000).setConnectTimeout(5000).build(); 35 | httpPost.setConfig(requestConfig); 36 | closeableHttpResponse = closeableHttpClient.execute(httpPost); 37 | int statusCode = closeableHttpResponse.getStatusLine().getStatusCode(); 38 | if (statusCode != HttpStatus.SC_OK) { 39 | throw new RuntimeException("\r\n#### 请求错误 ####\r\n响应状态码:" 40 | + statusCode 41 | + "\r\n请求地址:" 42 | + pushUrl); 43 | } 44 | HttpEntity httpEntity = closeableHttpResponse.getEntity(); 45 | return EntityUtils.toString(httpEntity, "UTF-8"); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/net/renfei/indexing/service/BaiduService.java: -------------------------------------------------------------------------------- 1 | package net.renfei.indexing.service; 2 | 3 | import org.apache.http.HttpEntity; 4 | import org.apache.http.HttpStatus; 5 | import org.apache.http.client.config.RequestConfig; 6 | import org.apache.http.client.methods.CloseableHttpResponse; 7 | import org.apache.http.client.methods.HttpPost; 8 | import org.apache.http.entity.ContentType; 9 | import org.apache.http.entity.StringEntity; 10 | import org.apache.http.impl.client.CloseableHttpClient; 11 | import org.apache.http.impl.client.HttpClients; 12 | import org.apache.http.util.EntityUtils; 13 | 14 | import java.io.IOException; 15 | 16 | public class BaiduService { 17 | private final String siteUrl; 18 | private final String baiduToken; 19 | 20 | public BaiduService(String siteUrl, String baiduToken) { 21 | this.siteUrl = siteUrl; 22 | this.baiduToken = baiduToken; 23 | } 24 | 25 | public String push(String url) throws IOException { 26 | return push(url, false); 27 | } 28 | 29 | public String push(String url, boolean isMobile) throws IOException { 30 | String pushUrl = "http://data.zz.baidu.com/urls?site=" + siteUrl + "&token=" + baiduToken; 31 | if (isMobile) { 32 | pushUrl = "http://data.zz.baidu.com/urls?site=" + siteUrl + "&token=" + baiduToken + "&type=daily"; 33 | } 34 | CloseableHttpClient closeableHttpClient = HttpClients.createDefault(); 35 | CloseableHttpResponse closeableHttpResponse; 36 | HttpPost httpPost = new HttpPost(pushUrl); 37 | httpPost.addHeader("Content-Type", "text/plain"); 38 | StringEntity entity = new StringEntity(url, ContentType.create("text/plain", "UTF-8")); 39 | httpPost.setEntity(entity); 40 | RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(5000).setConnectTimeout(5000).build(); 41 | httpPost.setConfig(requestConfig); 42 | closeableHttpResponse = closeableHttpClient.execute(httpPost); 43 | int statusCode = closeableHttpResponse.getStatusLine().getStatusCode(); 44 | if (statusCode != HttpStatus.SC_OK) { 45 | throw new RuntimeException("\r\n#### 请求错误 ####\r\n响应状态码:" + statusCode + "\r\n请求地址:" + pushUrl); 46 | } 47 | HttpEntity httpEntity = closeableHttpResponse.getEntity(); 48 | return EntityUtils.toString(httpEntity, "UTF-8"); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/net/renfei/indexing/service/QiHu360Service.java: -------------------------------------------------------------------------------- 1 | package net.renfei.indexing.service; 2 | 3 | import org.apache.http.HttpEntity; 4 | import org.apache.http.HttpStatus; 5 | import org.apache.http.client.config.RequestConfig; 6 | import org.apache.http.client.methods.CloseableHttpResponse; 7 | import org.apache.http.client.methods.HttpGet; 8 | import org.apache.http.impl.client.CloseableHttpClient; 9 | import org.apache.http.impl.client.HttpClients; 10 | import org.apache.http.util.EntityUtils; 11 | 12 | import java.io.IOException; 13 | import java.util.ArrayList; 14 | import java.util.Collections; 15 | 16 | /** 17 | * 360 搜索 18 | * 19 | * @author renfei 20 | */ 21 | public class QiHu360Service { 22 | private final String token; 23 | 24 | public QiHu360Service(String token) { 25 | this.token = token; 26 | } 27 | 28 | public String push(String url) throws IOException { 29 | String pushUrl = "http://s.360.cn/so/zz.gif?url=" + url + "&sid=" + token + "&token=" + getParameter(url, token); 30 | CloseableHttpClient closeableHttpClient = HttpClients.createDefault(); 31 | CloseableHttpResponse closeableHttpResponse; 32 | HttpGet httpPost = new HttpGet(pushUrl); 33 | RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(5000).setConnectTimeout(5000).build(); 34 | httpPost.setConfig(requestConfig); 35 | closeableHttpResponse = closeableHttpClient.execute(httpPost); 36 | int statusCode = closeableHttpResponse.getStatusLine().getStatusCode(); 37 | if (statusCode != HttpStatus.SC_OK) { 38 | throw new RuntimeException("\r\n#### 请求错误 ####\r\n响应状态码:" 39 | + statusCode 40 | + "\r\n请求地址:" 41 | + pushUrl); 42 | } 43 | HttpEntity httpEntity = closeableHttpResponse.getEntity(); 44 | return EntityUtils.toString(httpEntity, "UTF-8"); 45 | } 46 | 47 | private static String getParameter(String url, String token) { 48 | String[] n = reverse(url.split("")), r = token.split(""); 49 | StringBuilder i = new StringBuilder(); 50 | for (int s = 0, o = 16; s < o; s++) { 51 | i.append(r[s]).append(n[s] == null ? "" : n[s]); 52 | } 53 | return i.toString(); 54 | } 55 | 56 | private static String[] reverse(String[] arr) { 57 | String[] reverseArray = new String[arr.length]; 58 | ArrayList arraylist = new ArrayList<>(); 59 | Collections.addAll(arraylist, arr); 60 | Collections.reverse(arraylist); 61 | for (int i = 0; i < arr.length; i++) { 62 | reverseArray[i] = (String) arraylist.get(i); 63 | } 64 | return reverseArray; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/net/renfei/indexing/service/GoogleService.java: -------------------------------------------------------------------------------- 1 | package net.renfei.indexing.service; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; 5 | import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; 6 | import com.google.api.client.http.*; 7 | import com.google.api.client.json.JsonFactory; 8 | import com.google.api.client.json.jackson2.JacksonFactory; 9 | import net.renfei.indexing.entity.GoogleIndexingEntity; 10 | 11 | import java.io.FileInputStream; 12 | import java.io.IOException; 13 | import java.io.InputStream; 14 | import java.security.GeneralSecurityException; 15 | import java.util.Collections; 16 | 17 | /** 18 | * Google提供的服务 19 | * 20 | * @author RenFei 21 | */ 22 | public class GoogleService { 23 | private final String googleJsonPath; 24 | private HttpTransport httpTransport; 25 | 26 | public GoogleService(String googleJsonPath) { 27 | this.googleJsonPath = googleJsonPath; 28 | } 29 | 30 | public HttpResponse update(String url) throws IOException, GeneralSecurityException { 31 | GoogleCredential googleCredential = getGoogleCredential("https://www.googleapis.com/auth/indexing"); 32 | GoogleIndexingEntity googleIndexingEntity = new GoogleIndexingEntity(); 33 | googleIndexingEntity.setUrl(url); 34 | googleIndexingEntity.setType("URL_UPDATED"); 35 | return this.publish(googleCredential, googleIndexingEntity); 36 | } 37 | 38 | public HttpResponse publish(GoogleCredential googleCredential, GoogleIndexingEntity googleIndexingEntity) throws IOException { 39 | String endPoint = "https://indexing.googleapis.com/v3/urlNotifications:publish"; 40 | GenericUrl genericUrl = new GenericUrl(endPoint); 41 | String content = JSON.toJSONString(googleIndexingEntity); 42 | HttpRequestFactory requestFactory = this.httpTransport.createRequestFactory(); 43 | HttpRequest request = 44 | requestFactory.buildPostRequest(genericUrl, ByteArrayContent.fromString("application/json", content)); 45 | googleCredential.initialize(request); 46 | return request.execute(); 47 | } 48 | 49 | public GoogleCredential getGoogleCredential(String scopes) throws IOException, GeneralSecurityException { 50 | return getGoogleCredential(googleJsonPath, scopes); 51 | } 52 | 53 | public GoogleCredential getGoogleCredential(String path, String scopes) throws IOException, GeneralSecurityException { 54 | return getGoogleCredential(new FileInputStream(path), scopes); 55 | } 56 | 57 | public GoogleCredential getGoogleCredential(InputStream in, String scopes) throws IOException, GeneralSecurityException { 58 | JsonFactory jsonFactory = new JacksonFactory(); 59 | initHttpTransport(); 60 | return GoogleCredential.fromStream(in, this.httpTransport, jsonFactory).createScoped(Collections.singleton(scopes)); 61 | } 62 | 63 | private void initHttpTransport() throws GeneralSecurityException, IOException { 64 | if (this.httpTransport == null) { 65 | this.httpTransport = GoogleNetHttpTransport.newTrustedTransport(); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/net/renfei/indexing/service/ExtractSitemapService.java: -------------------------------------------------------------------------------- 1 | package net.renfei.indexing.service; 2 | 3 | import net.renfei.indexing.ui.MainWindow; 4 | import net.renfei.sdk.utils.BeanUtils; 5 | import org.w3c.dom.Document; 6 | import org.w3c.dom.Node; 7 | import org.w3c.dom.NodeList; 8 | 9 | import javax.xml.parsers.DocumentBuilder; 10 | import javax.xml.parsers.DocumentBuilderFactory; 11 | import java.util.HashSet; 12 | import java.util.Set; 13 | 14 | public class ExtractSitemapService implements Runnable { 15 | private MainWindow mainWindow; 16 | 17 | public ExtractSitemapService(MainWindow mainWindow) { 18 | this.mainWindow = mainWindow; 19 | } 20 | 21 | @Override 22 | public void run() { 23 | String site = mainWindow.siteUrl.getText(); 24 | if (BeanUtils.isEmpty(site)) { 25 | mainWindow.setLog("【站点URL】不能为空。"); 26 | return; 27 | } 28 | if (site.endsWith("/")) { 29 | site += "sitemap.xml"; 30 | } else { 31 | site += "/sitemap.xml"; 32 | } 33 | mainWindow.setLog("访问 " + site); 34 | DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); 35 | try { 36 | DocumentBuilder db = dbf.newDocumentBuilder(); 37 | Document document = db.parse(site); 38 | NodeList sitemapList = document.getElementsByTagName("sitemap"); 39 | if (sitemapList.getLength() > 0) { 40 | mainWindow.setLog("检测到站点地图集合"); 41 | for (int i = 0; i < sitemapList.getLength(); i++) { 42 | Node item = sitemapList.item(i); 43 | NodeList childNodes = item.getChildNodes(); 44 | for (int j = 0; j < childNodes.getLength(); j++) { 45 | String nodeName = childNodes.item(j).getTextContent().trim(); 46 | if (!nodeName.isEmpty() && "loc".equalsIgnoreCase(childNodes.item(j).getNodeName())) { 47 | getUrl(nodeName); 48 | } 49 | } 50 | } 51 | } else { 52 | getUrl(site); 53 | } 54 | mainWindow.setLog("执行结束"); 55 | } catch (Exception e) { 56 | mainWindow.setLog("\n[!] 发生错误:\r\n" + e.getMessage() + "\r\n如果您认为不是您的错误,请联系开发者:i@renfei.net。\r\n"); 57 | } 58 | } 59 | 60 | private void getUrl(String url) { 61 | mainWindow.setLog("发现网站地图:" + url); 62 | DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); 63 | try { 64 | DocumentBuilder db = dbf.newDocumentBuilder(); 65 | Document document = db.parse(url); 66 | NodeList sitemapList = document.getElementsByTagName("url"); 67 | for (int i = 0; i < sitemapList.getLength(); i++) { 68 | Node item = sitemapList.item(i); 69 | NodeList childNodes = item.getChildNodes(); 70 | for (int j = 0; j < childNodes.getLength(); j++) { 71 | String nodeName = childNodes.item(j).getTextContent().trim(); 72 | if ("loc".equalsIgnoreCase(childNodes.item(j).getNodeName())) { 73 | mainWindow.urls.append("\r\n" + nodeName); 74 | } 75 | } 76 | } 77 | } catch (Exception e) { 78 | mainWindow.setLog("\n[!] 发生错误:\r\n" + e.getMessage() + "\r\n如果您认为不是您的错误,请联系开发者:i@renfei.net。\r\n"); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Indexing - 搜索引擎推送工具 - SEO 工具箱](./doc/image/indexing_tools.gif) 2 | # Indexing - 百度-必应-谷歌 搜索引擎推送工具 3 | 此工具利用「百度-必应-谷歌」站长工具或开放平台接口即时推送网站更新给搜索引擎,加快蜘蛛程序爬取与更新。 4 | 此工具代码作者已经使用多年,同时作者正在探索 Swing/AWT 编程,此工具作为作者 Swing/AWT 编程处女作,顺便将技术能力通过可视化界面分享出来,让不懂编程的站长也可以使用 API 接口的便利。 5 | 6 | > 2023年11月30日百度站长平台将【快速收录】权限和【sitemap】提交权限全部收回,在此声明,权限的收回与使用我的《站长推送工具》无关,详见:[百度站长平台快速收录权限和sitemap提交权限被全部收回](https://www.renfei.net/posts/1626402130325676113) 7 | 8 | ## 安全声明 9 | 作为软件开发工程师的我,深知安全的重要性,因为此工具运行时需要站长提供 API 的 Token 令牌,这就相当于密码授权。 10 | 为了证明此工具不会抓取上传站长的 Token 令牌,所以开源公布出来,欢迎监督。(PS:本来想闭源使用混淆编译发布,防止被仿冒) 11 | 因为开源以后任何人可以利用源码修改制作小版本,站长们请认准 renfei.net 官网。如果发现仿冒请向我举报。 12 | ### 配置文件安全告知 13 | 如果您勾选了「将配置保存到本地,下次自动加载」选项,您所填的站点URL、Token、JSON路径信息将以明文文件的形式保存在您本地硬盘文件系统中。此功能在「1.0.2」版本中被加入。 14 | 通常这没什么问题,但出于安全性考虑我需要告知您以下信息: 15 | - 您所填的站点URL、Token、JSON路径信息将以明文(未加密)文件的形式保存在您本地硬盘文件系统中。 16 | - 其他拥有硬盘文件系统读写权限的程序可以访问到配置文件,例如有病毒扫描磁盘时可能会被读取。 17 | - 保存位置:程序将在用户目录下创建一个名为「Indexing.conf」的文件。 18 | - 「用户目录」一般指用户所属目录,在Linux系统中一般路径为「/home/username」,在macOS系统中一般路径为「/Users/username」,在Windows系统中一般是桌面路径为「C:\Users\username\Desktop」。username指你的用户名。 19 | 20 | ![配置文件安全告知](./doc/image/3fca3b7e7fda4a9b808b6858cd6c2074.jpg) 21 | 22 | ## 使用帮助 23 | 本工具基于 Java8 制作,如果您拥有 Java8 或更高的 JDK/JRE 环境,可以直接下载 Jar 包文件,使用如下命令即可启动: 24 | ```bash 25 | java -jar Indexing.jar 26 | ``` 27 | 如果您不确定自己的环境是否拥有 JDK/JRE,我还提供了环境打包版本,由于操作系统不同请下载对应的版本,执行其中的 start 脚本。 28 | 例如在 Windows 下,您只需双击 start.bat 文件。 29 | 30 | ### 运行效果图 31 | ![运行效果图](./doc/image/27c3ec0b22684032a66ccaf2f6dd9b22.png) 32 | 33 | ## 发布与下载 34 | 请下载对应的环境,执行 start 脚本: 35 | - Gitee发布与下载:[https://gitee.com/rnf/Indexing/releases](https://gitee.com/rnf/Indexing/releases) 36 | - Github发布与下载:[https://github.com/renfei/Indexing/releases](https://github.com/renfei/Indexing/releases) 37 | 38 | ## 其他说明 39 | - 百度Token获取地址: https://ziyuan.baidu.com/linksubmit/index 40 | - 必应Token获取地址:https://docs.microsoft.com/en-us/bingwebmaster/getting-access#using-api-key 41 | - 谷歌JSON私钥获取:https://www.renfei.net/posts/1003342 42 | - 谷歌上报需要本地是"你懂得"状态,否则网络不通,总是触发关键词「根据相关法律政策,该内容无法显示」 43 | - 360搜索Token获取:http://zhanzhang.so.com/sitetool/auto_include 44 | - 各个平台的接口提交配额与本工具无关,是各个平台分配给你的;例如百度快速收录是百度站长工具给予的权限,与是否使用本工具无关 45 | - 本工具不会收集上报用户的Token,本工具代码已开源,欢迎监督,如遇仿制程序上报Token请联系 i@renfei.net 46 | 47 | ### 关于360搜索的说明 48 | 360站长平台自动收录功能于2021年5月10日下线关闭。官方公告:[https://bbs.360.cn/thread-15979727-1-1.html](https://bbs.360.cn/thread-15979727-1-1.html) 49 | 50 | 感谢 [@xfanly](https://gitee.com/xfanly) 的反馈:[https://gitee.com/rnf/Indexing/issues/I4J425](https://gitee.com/rnf/Indexing/issues/I4J425#note_7484735) 51 | > ~~360搜索并未提供提交API接口,此工具使用的是「360搜索自动收录」模拟JS运行提交的,获取Token的方法为,在 http://zhanzhang.so.com/sitetool/auto_include 中有如下代码:~~ 52 | > ```javascript 53 | > 59 | > ``` 60 | > ~~其中```d182b3f28525f2d3wgacfbs36e696dba```就是要取出的Token。~~ 61 | 62 | ### 关于从站点地图中提取链接 63 | 64 | 此功能在```1.0.3```版本中加入。需求来自:[github.com/renfei/Indexing/issues/3](https://github.com/renfei/Indexing/issues/3) 65 | 66 | 需要注意:Indexing 接口的本意是:新内容产生时,及时通知搜索引擎爬取,确保新内容的及时收录。 67 | 68 | 网站地图包含了全站连接,其中包括陈旧的内容,所以会产生以下问题: 69 | 70 | - Indexing 接口滥用,因为提交的并不是新产生的内容,包含大量陈旧可能违反搜索引擎的用户使用协议,可能导致接口权限被收回 71 | - 全站链接数量过大,部分接口每天每月有使用限额,一口气提交会导致接口使用额度耗尽 72 | - 搜索引擎本就会爬取站点地图,重复提交里面的内容并不会有什么特殊的处理 73 | 74 | 请合理使用您的 API 资源,避免滥用被搜索引擎封禁 API 权限。 75 | 76 | ### 代码仓库 77 | - Gitee:[https://gitee.com/rnf/Indexing](https://gitee.com/rnf/Indexing) 78 | - Github:[https://github.com/renfei/Indexing](https://github.com/renfei/Indexing) 79 | - Gitlab:[https://gitlab.com/renfei/Indexing](https://gitlab.com/renfei/Indexing) 80 | 81 | ### 求鼓励 82 | 83 | 如果这个项目帮助到了你,是否能给我点个免费的星星 (Star) 给个鼓励呢。高星项目我将持续关注努力更新的。 -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | net.renfei 8 | Indexing 9 | 1.0.4 10 | Indexing 11 | https://www.renfei.net/kitbox/indexing 12 | Indexing - 搜索引擎推送工具 - SEO 工具箱 13 | 14 | 15 | 16 | The Apache License, Version 2.0 17 | http://www.apache.org/licenses/LICENSE-2.0.txt 18 | 19 | 20 | 21 | 22 | GitHub Issues 23 | https://github.com/renfei/Indexing/issues 24 | 25 | 26 | 2021 27 | 28 | 29 | scm:git:git://github.com/renfei/Indexing.git 30 | scm:git:git@github.com:renfei/Indexing.git 31 | https://github.com/renfei/Indexing 32 | 33 | 34 | 35 | 36 | renfei 37 | RenFei 38 | i@renfei.net 39 | 40 | owner 41 | developer 42 | 43 | RENFEI.NET 44 | https://www.renfei.net 45 | +8 46 | 47 | 48 | 49 | 50 | 8 51 | 8 52 | 53 | 54 | 55 | 56 | net.renfei 57 | sdk 58 | 1.0.14 59 | 60 | 61 | com.google.apis 62 | google-api-services-indexing 63 | v3-rev71-1.25.0 64 | 65 | 66 | com.intellij 67 | forms_rt 68 | 7.0.3 69 | 70 | 71 | 72 | 73 | Indexing 74 | 75 | 76 | org.codehaus.mojo 77 | ideauidesigner-maven-plugin 78 | 1.0-beta-1 79 | 80 | 81 | 82 | javac2 83 | 84 | 85 | 86 | 87 | true 88 | true 89 | true 90 | 91 | 92 | 93 | maven-assembly-plugin 94 | 2.6 95 | 96 | 97 | 98 | net.renfei.indexing.Application 99 | 100 | 101 | 102 | jar-with-dependencies 103 | 104 | 105 | 106 | 107 | make-assembly 108 | package 109 | 110 | single 111 | 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /src/main/java/net/renfei/indexing/ui/MenuBar.java: -------------------------------------------------------------------------------- 1 | package net.renfei.indexing.ui; 2 | 3 | import net.renfei.indexing.Application; 4 | import net.renfei.indexing.service.CheckVersionService; 5 | import net.renfei.sdk.utils.DateUtils; 6 | 7 | import javax.swing.*; 8 | import java.awt.*; 9 | import java.awt.event.ActionEvent; 10 | import java.awt.event.ActionListener; 11 | import java.awt.event.InputEvent; 12 | import java.awt.event.KeyEvent; 13 | import java.io.IOException; 14 | import java.net.URI; 15 | import java.net.URISyntaxException; 16 | 17 | /** 18 | * 菜单条 19 | * 20 | * @author renfei 21 | */ 22 | public class MenuBar extends JMenuBar { 23 | public MenuBar() { 24 | add(createFileMenu()); 25 | add(createEditMenu()); 26 | setVisible(true); 27 | } 28 | 29 | private JMenu createFileMenu() { 30 | JMenu menu = new JMenu("系统(S)"); 31 | JMenuItem item; 32 | item = new JMenuItem("工具箱(T)"); 33 | item.addActionListener(new ActionListener() { 34 | @Override 35 | public void actionPerformed(ActionEvent e) { 36 | try { 37 | openURL(new URI("https://www.renfei.net/kitbox?spm=application.indexing.st")); 38 | } catch (URISyntaxException uriSyntaxException) { 39 | JOptionPane.showMessageDialog(null, "打开失败,请手动打开: https://www.renfei.net/kitbox"); 40 | } 41 | } 42 | }); 43 | menu.add(item); 44 | menu.addSeparator(); 45 | item = new JMenuItem("退出(E)"); 46 | item.addActionListener(new ActionListener() { 47 | @Override 48 | public void actionPerformed(ActionEvent e) { 49 | System.exit(0); 50 | } 51 | }); 52 | menu.add(item); 53 | return menu; 54 | } 55 | 56 | private JMenu createEditMenu() { 57 | JMenu menu = new JMenu("帮助(H)"); 58 | JMenuItem item; 59 | item = new JMenuItem("主页(P)"); 60 | item.addActionListener(new ActionListener() { 61 | @Override 62 | public void actionPerformed(ActionEvent e) { 63 | try { 64 | openURL(new URI("https://www.renfei.net/kitbox/indexing?spm=application.indexing.hp")); 65 | } catch (URISyntaxException uriSyntaxException) { 66 | JOptionPane.showMessageDialog(null, "打开失败,请手动打开: https://www.renfei.net/kitbox/indexing"); 67 | } 68 | } 69 | }); 70 | menu.add(item); 71 | JMenu menuOpen = new JMenu("开源(O)"); 72 | item = new JMenuItem("Github"); 73 | item.addActionListener(new ActionListener() { 74 | @Override 75 | public void actionPerformed(ActionEvent e) { 76 | try { 77 | openURL(new URI("https://github.com/renfei/Indexing")); 78 | } catch (URISyntaxException uriSyntaxException) { 79 | JOptionPane.showMessageDialog(null, "打开失败,请手动打开: https://github.com/renfei/Indexing"); 80 | } 81 | } 82 | }); 83 | menuOpen.add(item); 84 | item = new JMenuItem("Gitee"); 85 | item.addActionListener(new ActionListener() { 86 | @Override 87 | public void actionPerformed(ActionEvent e) { 88 | try { 89 | openURL(new URI("https://gitee.com/rnf/Indexing")); 90 | } catch (URISyntaxException uriSyntaxException) { 91 | JOptionPane.showMessageDialog(null, "打开失败,请手动打开: https://gitee.com/rnf/Indexing"); 92 | } 93 | } 94 | }); 95 | menuOpen.add(item); 96 | menu.add(menuOpen); 97 | menu.addSeparator(); 98 | item = new JMenuItem("更新(U)"); 99 | item.addActionListener(new ActionListener() { 100 | @Override 101 | public void actionPerformed(ActionEvent e) { 102 | CheckVersionService.checkVersion(); 103 | } 104 | }); 105 | menu.add(item); 106 | item = new JMenuItem("关于(A)"); 107 | item.addActionListener(new ActionListener() { 108 | @Override 109 | public void actionPerformed(ActionEvent e) { 110 | StringBuilder sb = new StringBuilder("\t\t--== 关于==--\t\t").append("\r\n"); 111 | sb.append("\r\n"); 112 | sb.append("版本号:" + Application.VERSION).append("\r\n"); 113 | sb.append("「Indexing」是一个集合了百度、必应、谷歌搜索引擎网址推送的工具。").append("\r\n"); 114 | sb.append("主要用于即时向搜索引擎蜘蛛推送本站的更新动态,加快蜘蛛程序爬取和更新。").append("\r\n"); 115 | sb.append("\r\n"); 116 | sb.append("Copyright © ").append(DateUtils.getDate("yyyy")).append(" RENFEI.NET All rights reserved.").append("\r\n"); 117 | JOptionPane.showMessageDialog(Application.MAIN_WINDOW.mainPanel, 118 | sb.toString(), "关于", JOptionPane.PLAIN_MESSAGE); 119 | } 120 | }); 121 | menu.add(item); 122 | return menu; 123 | } 124 | 125 | public static void openURL(URI uri) { 126 | try { 127 | Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null; 128 | if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) { 129 | try { 130 | desktop.browse(uri); 131 | } catch (Exception e) { 132 | e.printStackTrace(); 133 | } 134 | } else { 135 | JOptionPane.showMessageDialog(null, "打开失败,请手动打开:" + uri); 136 | } 137 | } catch (Exception e) { 138 | e.printStackTrace(); 139 | JOptionPane.showMessageDialog(null, "打开失败,请手动打开:" + uri); 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /src/main/java/net/renfei/indexing/service/ExecService.java: -------------------------------------------------------------------------------- 1 | package net.renfei.indexing.service; 2 | 3 | import com.google.api.client.http.HttpResponse; 4 | import net.renfei.indexing.entity.ConfigVO; 5 | import net.renfei.indexing.ui.MainWindow; 6 | import net.renfei.sdk.utils.BeanUtils; 7 | 8 | import javax.swing.text.BadLocationException; 9 | import java.io.BufferedReader; 10 | import java.io.File; 11 | import java.io.IOException; 12 | import java.io.InputStreamReader; 13 | import java.security.GeneralSecurityException; 14 | import java.util.List; 15 | 16 | /** 17 | * @author renfei 18 | */ 19 | public class ExecService implements Runnable { 20 | private BaiduService baiduService; 21 | private BingService bingService; 22 | private GoogleService googleService; 23 | private QiHu360Service qiHu360Service; 24 | private MainWindow mainWindow; 25 | 26 | public ExecService(MainWindow mainWindow) { 27 | this.mainWindow = mainWindow; 28 | } 29 | 30 | public String execBaidu(String siteUrl, String baiduToken, String url) throws IOException { 31 | if (baiduService == null) { 32 | baiduService = new BaiduService(siteUrl, baiduToken); 33 | } 34 | return baiduService.push(url); 35 | } 36 | 37 | public String execBaiduKuaiSu(String siteUrl, String baiduToken, String url) throws IOException { 38 | if (baiduService == null) { 39 | baiduService = new BaiduService(siteUrl, baiduToken); 40 | } 41 | return baiduService.push(url, true); 42 | } 43 | 44 | public String execBing(String siteUrl, String bingToken, String url) throws IOException { 45 | if (bingService == null) { 46 | bingService = new BingService(siteUrl, bingToken); 47 | } 48 | return bingService.push(url); 49 | } 50 | 51 | public String execGoogle(String googleJsonPath, String url) throws IOException, GeneralSecurityException { 52 | if (BeanUtils.isEmpty(googleJsonPath)) { 53 | throw new RuntimeException("请先选择谷歌私钥JSON文件"); 54 | } 55 | if (googleJsonPath.endsWith(".json")) { 56 | File file = new File(googleJsonPath); 57 | if (file.exists()) { 58 | if (googleService == null) { 59 | googleService = new GoogleService(googleJsonPath); 60 | } 61 | HttpResponse httpResponse = googleService.update(url); 62 | BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpResponse.getContent())); 63 | StringBuilder sb = new StringBuilder(); 64 | String sTempOneLine; 65 | while ((sTempOneLine = bufferedReader.readLine()) != null) { 66 | sb.append(sTempOneLine); 67 | } 68 | return sb.toString(); 69 | } else { 70 | throw new RuntimeException(".json文件不存在"); 71 | } 72 | } else { 73 | throw new RuntimeException("请选择.json的文件"); 74 | } 75 | } 76 | 77 | public String exec360SO(String soToken, String url) throws IOException { 78 | if (qiHu360Service == null) { 79 | qiHu360Service = new QiHu360Service(soToken); 80 | } 81 | return qiHu360Service.push(url); 82 | } 83 | 84 | private void execBaidu(String siteUrl) throws BadLocationException, IOException { 85 | mainWindow.setLog("开始执行百度普通收录推送"); 86 | String token = mainWindow.baiduToken.getText(); 87 | if (BeanUtils.isEmpty(token)) { 88 | mainWindow.setLog("【百度Token】为空,跳过执行。"); 89 | } else { 90 | List urlList = mainWindow.getUrlTexts(); 91 | for (String url : urlList 92 | ) { 93 | mainWindow.setLog("推送:" + url); 94 | mainWindow.setLog("结果:" + execBaidu(siteUrl, token, url)); 95 | } 96 | } 97 | } 98 | 99 | private void execBaiduKuaiSu(String siteUrl) throws BadLocationException, IOException { 100 | mainWindow.setLog("开始执行百度快速收录推送"); 101 | String token = mainWindow.baiduToken.getText(); 102 | if (BeanUtils.isEmpty(token)) { 103 | mainWindow.setLog("【百度Token】为空,跳过执行。"); 104 | } else { 105 | List urlList = mainWindow.getUrlTexts(); 106 | for (String url : urlList 107 | ) { 108 | mainWindow.setLog("推送:" + url); 109 | mainWindow.setLog("结果:" + execBaiduKuaiSu(siteUrl, token, url)); 110 | } 111 | } 112 | } 113 | 114 | private void execBing(String siteUrl) throws BadLocationException, IOException { 115 | mainWindow.setLog("开始执行必应推送"); 116 | String token = mainWindow.bingToken.getText(); 117 | if (BeanUtils.isEmpty(token)) { 118 | mainWindow.setLog("【必应Token】为空,跳过执行。"); 119 | } else { 120 | List urlList = mainWindow.getUrlTexts(); 121 | for (String url : urlList 122 | ) { 123 | mainWindow.setLog("推送:" + url); 124 | mainWindow.setLog("结果:" + execBing(siteUrl, token, url)); 125 | } 126 | } 127 | } 128 | 129 | private void execGoogle(String siteUrl) throws BadLocationException, IOException, GeneralSecurityException { 130 | mainWindow.setLog("开始执行谷歌推送"); 131 | String token = mainWindow.googleJson.getText(); 132 | if (BeanUtils.isEmpty(token) || "点击选择JSON文件".equals(token)) { 133 | mainWindow.setLog("【谷歌私钥】为空,跳过执行。"); 134 | } else { 135 | List urlList = mainWindow.getUrlTexts(); 136 | for (String url : urlList 137 | ) { 138 | mainWindow.setLog("推送:" + url); 139 | mainWindow.setLog("结果:" + execGoogle(mainWindow.googleJson.getText(), url)); 140 | } 141 | } 142 | } 143 | 144 | private void exec360SO() throws BadLocationException, IOException { 145 | mainWindow.setLog("开始执行360搜索推送"); 146 | String token = mainWindow.soToken.getText(); 147 | if (BeanUtils.isEmpty(token)) { 148 | mainWindow.setLog("【360搜索Token】为空,跳过执行。"); 149 | } else { 150 | List urlList = mainWindow.getUrlTexts(); 151 | for (String url : urlList 152 | ) { 153 | mainWindow.setLog("推送:" + url); 154 | try { 155 | exec360SO(token, url); 156 | mainWindow.setLog("结果:成功!"); 157 | } catch (Exception e) { 158 | mainWindow.setLog("结果:失败!" + e.getMessage()); 159 | } 160 | 161 | } 162 | } 163 | } 164 | 165 | @Override 166 | public void run() { 167 | String site = mainWindow.siteUrl.getText(); 168 | if (BeanUtils.isEmpty(site)) { 169 | mainWindow.setLog("【站点URL】不能为空。"); 170 | return; 171 | } 172 | if (mainWindow.saveConfig.isSelected()) { 173 | ConfigVO configVO = new ConfigVO(); 174 | configVO.setSiteUrl(site); 175 | configVO.setBaiduToken(mainWindow.baiduToken.getText()); 176 | configVO.setBingToken(mainWindow.bingToken.getText()); 177 | configVO.setGoogleJsonPath(mainWindow.googleJson.getText()); 178 | configVO.setSoToken(mainWindow.soToken.getText()); 179 | ConfigFileService.saveConfig(configVO); 180 | } else { 181 | ConfigFileService.deleteConfig(); 182 | } 183 | mainWindow.setLog("获取到【站点URL】:" + site); 184 | try { 185 | if (mainWindow.chkBaiduPuTong.isSelected()) { 186 | execBaidu(site); 187 | } 188 | if (mainWindow.chkBaiDuKuiSu.isSelected()) { 189 | execBaiduKuaiSu(site); 190 | } 191 | if (mainWindow.chkBing.isSelected()) { 192 | execBing(site); 193 | } 194 | if (mainWindow.chkGoogle.isSelected()) { 195 | execGoogle(site); 196 | } 197 | if (mainWindow.chkSo.isSelected()) { 198 | exec360SO(); 199 | } 200 | } catch (Exception e) { 201 | mainWindow.setLog("\n[!] 发生错误:\r\n" + e.getMessage() + "\r\n如果您认为不是您的错误,请联系开发者:i@renfei.net。\r\n"); 202 | } 203 | mainWindow.setLog("执行结束"); 204 | } 205 | } 206 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /src/main/java/net/renfei/indexing/ui/MainWindow.java: -------------------------------------------------------------------------------- 1 | package net.renfei.indexing.ui; 2 | 3 | import com.intellij.uiDesigner.core.GridConstraints; 4 | import com.intellij.uiDesigner.core.GridLayoutManager; 5 | import net.renfei.indexing.entity.ConfigVO; 6 | import net.renfei.indexing.service.ConfigFileService; 7 | import net.renfei.indexing.service.ExecService; 8 | import net.renfei.indexing.service.ExtractSitemapService; 9 | import net.renfei.sdk.utils.BeanUtils; 10 | import net.renfei.sdk.utils.DateUtils; 11 | 12 | import javax.swing.*; 13 | import javax.swing.text.BadLocationException; 14 | import java.awt.*; 15 | import java.awt.event.ActionEvent; 16 | import java.awt.event.ActionListener; 17 | import java.util.ArrayList; 18 | import java.util.List; 19 | 20 | import static javax.swing.JOptionPane.WARNING_MESSAGE; 21 | 22 | /** 23 | * 主窗体 24 | * 25 | * @author renfei 26 | */ 27 | public class MainWindow { 28 | public JPanel mainPanel; 29 | public JTextArea urls; 30 | public JTextArea logText; 31 | public JCheckBox chkBaiduPuTong; 32 | public JCheckBox chkGoogle; 33 | public JCheckBox chkBaiDuKuiSu; 34 | public JButton execButton; 35 | public JButton googleJson; 36 | public JCheckBox chkBing; 37 | public JTextField siteUrl; 38 | public JTextField baiduToken; 39 | public JTextField bingToken; 40 | public JTextArea explain; 41 | public JSplitPane rightSplitPane; 42 | public JScrollPane urlsScroPane; 43 | public JScrollPane logsScroPane; 44 | public JCheckBox saveConfig; 45 | public JTextField soToken; 46 | public JCheckBox chkSo; 47 | private JButton extractSitemapButtonButton; 48 | 49 | public void init() { 50 | urlsScroPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); 51 | logsScroPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); 52 | MainWindow mainWindow = this; 53 | execButton.addActionListener(new ActionListener() { 54 | @Override 55 | public void actionPerformed(ActionEvent e) { 56 | setLog("开始执行"); 57 | Thread execService = new Thread(new ExecService(mainWindow), "ExecService"); 58 | execService.start(); 59 | } 60 | }); 61 | googleJson.addActionListener(new ActionListener() { 62 | @Override 63 | public void actionPerformed(ActionEvent e) { 64 | JFileChooser fc = new JFileChooser("/"); 65 | int val = fc.showOpenDialog(null); 66 | if (val == JFileChooser.APPROVE_OPTION) { 67 | googleJson.setText(fc.getSelectedFile().getPath()); 68 | } else { 69 | googleJson.setText("点击选择JSON文件"); 70 | } 71 | } 72 | }); 73 | extractSitemapButtonButton.addActionListener(new ActionListener() { 74 | @Override 75 | public void actionPerformed(ActionEvent e) { 76 | int opt = JOptionPane.showConfirmDialog(extractSitemapButtonButton, 77 | "点击确认将从网站地图文件(sitemap.xml)中提取链接,但是请注意:\n\n" + 78 | "Indexing 接口的本意是:新内容产生时,及时通知搜索引擎爬取,确保新内容的及时收录。\n" + 79 | "网站地图包含了全站连接,其中包括陈旧的内容,所以会产生以下问题:\n\n" + 80 | "1.Indexing 接口滥用,因为提交的并不是新产生的内容,包含大量陈旧可能违反搜索引擎的用户使用协议,可能导致接口权限被收回\n" + 81 | "2.全站链接数量过大,部分接口每天每月有使用限额,一口气提交会导致接口使用额度耗尽\n\n" + 82 | "请知晓以上说明,自行合理的使用 API。", 83 | "从站点地图中提取链接", 84 | JOptionPane.YES_NO_OPTION, WARNING_MESSAGE); 85 | if (opt == JOptionPane.YES_OPTION) { 86 | //确认继续操作 87 | setLog("从站点地图中提取链接"); 88 | Thread execService = new Thread(new ExtractSitemapService(mainWindow), "ExtractSitemapService"); 89 | execService.start(); 90 | } 91 | } 92 | }); 93 | ConfigVO configVO = ConfigFileService.getConfig(); 94 | if (configVO != null) { 95 | siteUrl.setText(configVO.getSiteUrl()); 96 | baiduToken.setText(configVO.getBaiduToken()); 97 | bingToken.setText(configVO.getBingToken()); 98 | googleJson.setText(configVO.getGoogleJsonPath()); 99 | soToken.setText(configVO.getSoToken()); 100 | } 101 | } 102 | 103 | public void setLog(String log) { 104 | logText.append("\r\n" + DateUtils.getDate("yyyy-MM-dd HH:mm:ss") + " : " + log); 105 | } 106 | 107 | public List getUrlTexts() throws BadLocationException { 108 | List stringList = new ArrayList<>(urls.getRows()); 109 | for (int i = 0; i < urls.getLineCount(); i++) { 110 | int start = urls.getLineStartOffset(i); 111 | int end = urls.getLineEndOffset(i); 112 | String str = urls.getText(start, end - start).replace("\r\n", "").replace("\n", ""); 113 | if (!BeanUtils.isEmpty(str)) { 114 | if (str.startsWith(siteUrl.getText())) { 115 | stringList.add(str); 116 | } else { 117 | setLog("检测到【" + str + "】与站点URL不符,跳过处理。"); 118 | } 119 | } 120 | } 121 | return stringList; 122 | } 123 | 124 | { 125 | // GUI initializer generated by IntelliJ IDEA GUI Designer 126 | // >>> IMPORTANT!! <<< 127 | // DO NOT EDIT OR ADD ANY CODE HERE! 128 | $$$setupUI$$$(); 129 | } 130 | 131 | /** 132 | * Method generated by IntelliJ IDEA GUI Designer 133 | * >>> IMPORTANT!! <<< 134 | * DO NOT edit this method OR call it in your code! 135 | * 136 | * @noinspection ALL 137 | */ 138 | private void $$$setupUI$$$() { 139 | mainPanel = new JPanel(); 140 | mainPanel.setLayout(new BorderLayout(0, 0)); 141 | final JSplitPane splitPane1 = new JSplitPane(); 142 | splitPane1.setContinuousLayout(true); 143 | splitPane1.setDividerLocation(400); 144 | splitPane1.setDividerSize(5); 145 | mainPanel.add(splitPane1, BorderLayout.CENTER); 146 | rightSplitPane = new JSplitPane(); 147 | rightSplitPane.setDividerLocation(300); 148 | rightSplitPane.setDividerSize(5); 149 | rightSplitPane.setOrientation(0); 150 | splitPane1.setRightComponent(rightSplitPane); 151 | urlsScroPane = new JScrollPane(); 152 | rightSplitPane.setLeftComponent(urlsScroPane); 153 | urls = new JTextArea(); 154 | urls.setEditable(true); 155 | urls.setText("https://www.renfei.net/demo/1"); 156 | urlsScroPane.setViewportView(urls); 157 | logsScroPane = new JScrollPane(); 158 | rightSplitPane.setRightComponent(logsScroPane); 159 | logText = new JTextArea(); 160 | logText.setBackground(new Color(-1118482)); 161 | logText.setEditable(false); 162 | logText.setText("--== 运行日志 ==--"); 163 | logsScroPane.setViewportView(logText); 164 | final JPanel panel1 = new JPanel(); 165 | panel1.setLayout(new GridLayoutManager(16, 2, new Insets(0, 0, 0, 0), 2, 4)); 166 | splitPane1.setLeftComponent(panel1); 167 | final JLabel label1 = new JLabel(); 168 | label1.setText("百度Token:"); 169 | panel1.add(label1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 16), null, 0, false)); 170 | final JLabel label2 = new JLabel(); 171 | label2.setText("必应Token:"); 172 | panel1.add(label2, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 16), null, 0, false)); 173 | final JLabel label3 = new JLabel(); 174 | label3.setText("上报项:"); 175 | panel1.add(label3, new GridConstraints(8, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 16), null, 0, false)); 176 | chkBaiduPuTong = new JCheckBox(); 177 | chkBaiduPuTong.setSelected(true); 178 | chkBaiduPuTong.setText("百度普通收录"); 179 | panel1.add(chkBaiduPuTong, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 21), null, 0, false)); 180 | chkBaiDuKuiSu = new JCheckBox(); 181 | chkBaiDuKuiSu.setText("百度快速收录"); 182 | panel1.add(chkBaiDuKuiSu, new GridConstraints(9, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 21), null, 0, false)); 183 | chkGoogle = new JCheckBox(); 184 | chkGoogle.setText("谷歌搜索"); 185 | panel1.add(chkGoogle, new GridConstraints(11, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 21), null, 0, false)); 186 | execButton = new JButton(); 187 | execButton.setText("执行"); 188 | panel1.add(execButton, new GridConstraints(13, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 30), null, 0, false)); 189 | final JLabel label4 = new JLabel(); 190 | label4.setText("谷歌私钥:"); 191 | panel1.add(label4, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 16), null, 0, false)); 192 | final JLabel label5 = new JLabel(); 193 | label5.setText("使用说明:"); 194 | panel1.add(label5, new GridConstraints(14, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 16), null, 0, false)); 195 | chkBing = new JCheckBox(); 196 | chkBing.setText("必应搜索"); 197 | panel1.add(chkBing, new GridConstraints(10, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 21), null, 0, false)); 198 | siteUrl = new JTextField(); 199 | siteUrl.setText("https://www.renfei.net"); 200 | panel1.add(siteUrl, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 30), null, 0, false)); 201 | final JLabel label6 = new JLabel(); 202 | label6.setText("站点URL:"); 203 | panel1.add(label6, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 16), null, 0, false)); 204 | baiduToken = new JTextField(); 205 | panel1.add(baiduToken, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 30), null, 0, false)); 206 | bingToken = new JTextField(); 207 | panel1.add(bingToken, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 30), null, 0, false)); 208 | explain = new JTextArea(); 209 | explain.setBackground(new Color(-1118482)); 210 | explain.setEditable(false); 211 | explain.setLineWrap(true); 212 | explain.setText("1.百度Token获取地址: https://ziyuan.baidu.com/linksubmit/index\n2.必应Token获取地址:https://docs.microsoft.com/en-us/bingwebmaster/getting-access\n3.谷歌JSON私钥获取:https://www.renfei.net/posts/1003342\n4.谷歌上报需要本地是翻墙状态,否则网络不通\n5.各个平台的接口提交配额与本工具无关,是各个平台分配给你的;例如百度快速收录是百度站长工具给予的权限,与是否使用本工具无关\n6.本工具不会收集上报用户的Token,本工具代码已开源,欢迎监督,如遇仿制程序上报Token请联系 i@renfei.net"); 213 | explain.setWrapStyleWord(true); 214 | panel1.add(explain, new GridConstraints(15, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(30, 50), null, 0, false)); 215 | googleJson = new JButton(); 216 | googleJson.setText("点击选择JSON文件"); 217 | panel1.add(googleJson, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 30), null, 0, false)); 218 | saveConfig = new JCheckBox(); 219 | saveConfig.setSelected(true); 220 | saveConfig.setText("将配置保存到本地,下次自动加载"); 221 | panel1.add(saveConfig, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 21), null, 0, false)); 222 | final JLabel label7 = new JLabel(); 223 | label7.setText("360搜索Token:"); 224 | panel1.add(label7, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); 225 | soToken = new JTextField(); 226 | panel1.add(soToken, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 30), null, 0, false)); 227 | chkSo = new JCheckBox(); 228 | chkSo.setText("360搜索"); 229 | panel1.add(chkSo, new GridConstraints(12, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(30, 21), null, 0, false)); 230 | } 231 | 232 | /** 233 | * @noinspection ALL 234 | */ 235 | public JComponent $$$getRootComponent$$$() { 236 | return mainPanel; 237 | } 238 | 239 | } 240 | -------------------------------------------------------------------------------- /src/main/java/net/renfei/indexing/ui/MainWindow.form: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 |
286 | --------------------------------------------------------------------------------