feat: update Build step

pull/206/head
LiLittleCat 2 years ago
parent 8c4ca602e8
commit b2b310f610
  1. 122
      data/abnormal-websites.json
  2. 456
      data/normal-websites.json
  3. 41
      src/main/java/com.lilittlecat/freechatgpt/Build.java
  4. 1
      src/main/java/com.lilittlecat/freechatgpt/Website.java

@ -3,60 +3,64 @@
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":1,
"id":2,
"labels":null,
"lang":null,
"previewUrl":null,
"reportedInvalidDate":"2023-04-20",
"reportedInvalidDate":"2023-04-28",
"reportedInvalidReason":null,
"score":null,
"sourceInfo":null,
"status":null,
"title":null,
"updatedDate":null,
"url":"http://www.tdchatd.us/"
"url":"https://gpt.gpt0.icu"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":2,
"id":3,
"labels":null,
"lang":null,
"previewUrl":null,
"reportedInvalidDate":"2023-04-28",
"reportedInvalidDate":"2023-04-21",
"reportedInvalidReason":null,
"score":null,
"sourceInfo":null,
"status":null,
"title":null,
"updatedDate":null,
"url":"https://gpt.gpt0.icu"
"url":"https://chat2.zhuleixx.top/"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":3,
"id":1,
"labels":null,
"lang":null,
"previewUrl":null,
"reportedInvalidDate":"2023-04-21",
"reportedInvalidDate":"2023-04-20",
"reportedInvalidReason":null,
"score":null,
"sourceInfo":null,
"status":null,
"title":null,
"updatedDate":null,
"url":"https://chat2.zhuleixx.top/"
"url":"http://www.tdchatd.us/"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":4,
"labels":null,
@ -75,6 +79,7 @@
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":5,
"labels":null,
@ -93,6 +98,7 @@
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":6,
"labels":null,
@ -111,6 +117,7 @@
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":7,
"labels":null,
@ -129,6 +136,7 @@
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":8,
"labels":null,
@ -147,6 +155,7 @@
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":9,
"labels":null,
@ -165,6 +174,7 @@
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":10,
"labels":null,
@ -183,26 +193,28 @@
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":11,
"id":14,
"labels":null,
"lang":null,
"previewUrl":null,
"reportedInvalidDate":"2023-04-04",
"reportedInvalidDate":"2023-04-10",
"reportedInvalidReason":null,
"score":null,
"sourceInfo":null,
"status":null,
"title":null,
"updatedDate":null,
"url":"https://freegpt.one"
"url":"http://gitopenchina.gitee.io/freechatgpt"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":12,
"id":11,
"labels":null,
"lang":null,
"previewUrl":null,
@ -213,14 +225,15 @@
"status":null,
"title":null,
"updatedDate":null,
"url":"http://gitopenchina.gitee.io/gpt"
"url":"https://freegpt.one"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":13,
"id":12,
"labels":null,
"lang":null,
"previewUrl":null,
@ -231,30 +244,32 @@
"status":null,
"title":null,
"updatedDate":null,
"url":"http://gitopenchina.gitee.io/chatgpt"
"url":"http://gitopenchina.gitee.io/gpt"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":14,
"id":13,
"labels":null,
"lang":null,
"previewUrl":null,
"reportedInvalidDate":"2023-04-10",
"reportedInvalidDate":"2023-04-04",
"reportedInvalidReason":null,
"score":null,
"sourceInfo":null,
"status":null,
"title":null,
"updatedDate":null,
"url":"http://gitopenchina.gitee.io/freechatgpt"
"url":"http://gitopenchina.gitee.io/chatgpt"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":15,
"labels":null,
@ -273,44 +288,47 @@
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":16,
"id":18,
"labels":null,
"lang":null,
"previewUrl":null,
"reportedInvalidDate":"2023-04-03",
"reportedInvalidDate":"2023-04-04",
"reportedInvalidReason":null,
"score":null,
"sourceInfo":null,
"status":null,
"title":null,
"updatedDate":null,
"url":"https://qachat.cn/"
"url":"https://chat.tgbot.co/"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":17,
"id":19,
"labels":null,
"lang":null,
"previewUrl":null,
"reportedInvalidDate":"2023-04-01",
"reportedInvalidDate":"2023-04-04",
"reportedInvalidReason":null,
"score":null,
"sourceInfo":null,
"status":null,
"title":null,
"updatedDate":null,
"url":"https://www.askme.mom/"
"url":"https://chatgpt.ddiu.me"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":18,
"id":21,
"labels":null,
"lang":null,
"previewUrl":null,
@ -321,14 +339,15 @@
"status":null,
"title":null,
"updatedDate":null,
"url":"https://chat.tgbot.co/"
"url":"https://chat.yqcloud.top/"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":19,
"id":24,
"labels":null,
"lang":null,
"previewUrl":null,
@ -339,68 +358,72 @@
"status":null,
"title":null,
"updatedDate":null,
"url":"https://chatgpt.ddiu.me"
"url":"https://www.aitoolgpt.com/"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":20,
"id":26,
"labels":null,
"lang":null,
"previewUrl":null,
"reportedInvalidDate":"2023-03-22",
"reportedInvalidDate":"2023-04-04",
"reportedInvalidReason":null,
"score":null,
"sourceInfo":null,
"status":null,
"title":null,
"updatedDate":null,
"url":"https://xc.com/"
"url":"https://chat.ninvfeng.xyz/"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":21,
"id":16,
"labels":null,
"lang":null,
"previewUrl":null,
"reportedInvalidDate":"2023-04-04",
"reportedInvalidDate":"2023-04-03",
"reportedInvalidReason":null,
"score":null,
"sourceInfo":null,
"status":null,
"title":null,
"updatedDate":null,
"url":"https://chat.yqcloud.top/"
"url":"https://qachat.cn/"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":22,
"id":17,
"labels":null,
"lang":null,
"previewUrl":null,
"reportedInvalidDate":"2023-03-22",
"reportedInvalidDate":"2023-04-01",
"reportedInvalidReason":null,
"score":null,
"sourceInfo":null,
"status":null,
"title":null,
"updatedDate":null,
"url":"https://www.scyu.app/"
"url":"https://www.askme.mom/"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":23,
"id":20,
"labels":null,
"lang":null,
"previewUrl":null,
@ -411,32 +434,34 @@
"status":null,
"title":null,
"updatedDate":null,
"url":"https://chatgpt-flutter.h7ml.cn"
"url":"https://xc.com/"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":24,
"id":22,
"labels":null,
"lang":null,
"previewUrl":null,
"reportedInvalidDate":"2023-04-04",
"reportedInvalidDate":"2023-03-22",
"reportedInvalidReason":null,
"score":null,
"sourceInfo":null,
"status":null,
"title":null,
"updatedDate":null,
"url":"https://www.aitoolgpt.com/"
"url":"https://www.scyu.app/"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":25,
"id":23,
"labels":null,
"lang":null,
"previewUrl":null,
@ -447,24 +472,25 @@
"status":null,
"title":null,
"updatedDate":null,
"url":"https://chatapi.qload.cn"
"url":"https://chatgpt-flutter.h7ml.cn"
},
{
"addedDate":null,
"customDescription":null,
"description":null,
"extraInfo":null,
"features":null,
"id":26,
"id":25,
"labels":null,
"lang":null,
"previewUrl":null,
"reportedInvalidDate":"2023-04-04",
"reportedInvalidDate":"2023-03-22",
"reportedInvalidReason":null,
"score":null,
"sourceInfo":null,
"status":null,
"title":null,
"updatedDate":null,
"url":"https://chat.ninvfeng.xyz/"
"url":"https://chatapi.qload.cn"
}
]

File diff suppressed because it is too large Load Diff

@ -25,6 +25,24 @@ public class Build {
public static void main(String[] args) throws TemplateException, IOException {
Build build = new Build();
build.init();
// build.update();
}
public void update() {
String basePath = System.getProperty("user.dir");
File normalWebsitesJSON = new File(basePath + File.separator + "data" + File.separator + "normal-websites.json");
String normalWebsitesJSONString = FileUtil.readString(normalWebsitesJSON, StandardCharsets.UTF_8);
List<Website> normalWebsitesJSONArray = JSON.parseArray(normalWebsitesJSONString, Website.class);
File abnormalWebsitesJSON = new File(basePath + File.separator + "data" + File.separator + "abnormal-websites.json");
String abnormalWebsitesJSONString = FileUtil.readString(abnormalWebsitesJSON, StandardCharsets.UTF_8);
List<Website> abnormalWebsitesJSONArray = JSON.parseArray(abnormalWebsitesJSONString, Website.class);
}
public void init() throws IOException, TemplateException {
@ -39,18 +57,27 @@ public class Build {
List<Website> normalWebsites = new ArrayList<>();
int normalId = 1;
for (String normalSite : normalSites) {
String[] strings = normalSite.split(" - ");
if (strings.length < 2) {
continue;
}
// Extract the link
String link = extractLink(normalSite);
String link = extractLink(strings[0]);
// Extract the time
String time = extractTime(normalSite);
String time = extractTime(strings[1]);
if (StrUtil.isNotBlank(link) && StrUtil.isNotBlank(time)) {
Website website = new Website();
website.setId(normalId++);
website.setUrl(link);
website.setAddedDate(time);
if (strings.length > 2) {
website.setCustomDescription(strings[2]);
System.out.println(website.getId() + "." + link + " " + time + " " + strings[2]);
} else {
System.out.println(website.getId() + "." + link + " " + time);
}
normalWebsites.add(website);
}
System.out.println(link + " " + time);
}
String normalWebsitesJSONString = JSON.toJSONString(normalWebsites, SerializerFeature.WriteMapNullValue, SerializerFeature.PrettyFormat, SerializerFeature.SortField);
@ -71,9 +98,15 @@ public class Build {
website.setUrl(link);
website.setReportedInvalidDate(time);
abnormalWebsites.add(website);
System.out.println(link + " " + time);
}
System.out.println(link + " " + time);
}
// sorted by reportedInvalidDate desc
abnormalWebsites.sort((o1, o2) -> {
LocalDate date1 = LocalDate.parse(o1.getReportedInvalidDate());
LocalDate date2 = LocalDate.parse(o2.getReportedInvalidDate());
return date2.compareTo(date1);
});
String abnormalWebsitesJSONString = JSON.toJSONString(abnormalWebsites, SerializerFeature.WriteMapNullValue, SerializerFeature.PrettyFormat, SerializerFeature.SortField);
File abnormalWebsitesJSON = new File(basePath + File.separator + "data" + File.separator + "abnormal-websites.json");

@ -31,4 +31,5 @@ public class Website {
* 0: normal 1: abnormal
*/
private Integer status;
private Object extraInfo;
}

Loading…
Cancel
Save