Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed Apr 15, 2024
1 parent 1222cdf commit 932dafd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/InternetSearch/Client/ZoomEyeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ public String buildSearchUrl(String searchContent, int page) {
//https://www.zoomeye.hk/api/domain/search?q=google.com&p=1&s=10&type=1
//https://www.zoomeye.hk/api/search?q=site%3A%22baidu.com%22&page=1
String url = String.format(
"https://api.zoomeye.hk/api/search?q=%s&page=%s",searchContent,page);
"https://www.zoomeye.hk/api/search?q=%s&page=%s",searchContent,page);
return url;
}

@Override
public byte[] buildRawData(String searchContent, int page) {
//site:"baidu.com"
String raw = "GET /api/search?q=%s&page=%s HTTP/1.1\r\n"
+ "Host: api.zoomeye.hk\r\n"
+ "Host: www.zoomeye.hk\r\n"
+ "Accept: application/json, text/plain, */*\r\n"
+ "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36\r\n"
+ "Accept-Encoding: gzip, deflate\r\n"
Expand Down
8 changes: 6 additions & 2 deletions src/InternetSearch/SearchResultEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void setHost(String host) {

if (StringUtils.isEmpty(rootDomain)) {
if(DomainNameUtils.isValidDomain(host)) {
rootDomain = DomainNameUtils.getRootDomain(host);
this.rootDomain = DomainNameUtils.getRootDomain(host);
}
}
}
Expand All @@ -94,7 +94,11 @@ public String getRootDomain() {
}

public void setRootDomain(String rootDomain) {
this.rootDomain = rootDomain;
if(DomainNameUtils.isValidDomain(rootDomain)) {
this.rootDomain = DomainNameUtils.getRootDomain(rootDomain);
}else{
this.rootDomain = rootDomain;
}
}

public String getWebcontainer() {
Expand Down

0 comments on commit 932dafd

Please sign in to comment.