From 111f9884f18d78c3e23c927f0c3d19bee4a72393 Mon Sep 17 00:00:00 2001 From: "Ching Yi, Chan" Date: Sun, 4 Aug 2024 11:30:29 +0800 Subject: [PATCH] Update extra-info and enable auto-update Signed-off-by: Ching Yi, Chan --- .github/workflows/updater.yml | 6 ++--- dashboard/src/extra.json | 24 +++++------------ dashboard/src/jcconf.json | 26 +++++-------------- .../java/org/qty/crawler/DataUpdater.java | 4 +++ 4 files changed, 20 insertions(+), 40 deletions(-) diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml index 05b4496..954e9ca 100644 --- a/.github/workflows/updater.yml +++ b/.github/workflows/updater.yml @@ -2,10 +2,10 @@ name: Runner on: push: - branches: [ "main-disabled", "chore/auto-update" ] + branches: [ "main", "chore/2024" ] paths-ignore: [ "data.json", "ui-data.json" ] -# schedule: -# - cron: '17 * * * *' + schedule: + - cron: '17 * * * *' jobs: build: diff --git a/dashboard/src/extra.json b/dashboard/src/extra.json index 96de49f..cbac96b 100644 --- a/dashboard/src/extra.json +++ b/dashboard/src/extra.json @@ -6,10 +6,10 @@ "社群推廣區": [ { "category": "社群推廣區", - "title": "JCConf Taiwan 2023 \uD83E\uDD41 2023/10/06 (FRI) 9:00am \uD83E\uDD41 @台大醫院國際會議中心", - "url": "https://jcconf.tw/2023/", + "title": "JCConf Taiwan 2024 \uD83E\uDD41 2024/09/27 (FRI) 9:00am \uD83E\uDD41 @台大醫院國際會議中心", + "url": "https://jcconf.tw/2024/", "author": "JVM 生態圈", - "profileUrl": "https://jcconf.tw/2023/", + "profileUrl": "https://jcconf.tw/2024/", "anchor": "jcconf", "view": 1000, "lastUpdated": 1663075172739, @@ -18,10 +18,10 @@ }, { "category": "社群推廣區", - "title": "JCConf Taiwan 2023 \uD83D\uDCB8 kktix 售票亭", - "url": "https://twjug.kktix.cc/events/jcconf-2023", + "title": "JCConf Taiwan 2024 \uD83D\uDCB8 kktix 售票亭", + "url": "https://twjug.kktix.cc/events/jcconf-2024", "author": "JVM 生態圈", - "profileUrl": "https://twjug.kktix.cc/events/jcconf-2023", + "profileUrl": "https://twjug.kktix.cc/events/jcconf-2024", "anchor": "jcconf-kktix", "view": 1000, "lastUpdated": 1663075172739, @@ -52,18 +52,6 @@ "articles": [], "status": "ONGOING" }, - { - "category": "社群推廣區", - "title": "Kotlin 練功場 ", - "url": "https://tw.kotlin.tips/dojos", - "author": "Kotlin 宇宙", - "profileUrl": "https://tw.kotlin.tips/dojos", - "anchor": "Kotlin 宇宙", - "view": 6666, - "lastUpdated": 1663075172739, - "articles": [], - "status": "ONGOING" - }, { "category": "社群推廣區", "title": "Clojure 中文討論區", diff --git a/dashboard/src/jcconf.json b/dashboard/src/jcconf.json index f33b0e0..7a7f08e 100644 --- a/dashboard/src/jcconf.json +++ b/dashboard/src/jcconf.json @@ -5,23 +5,11 @@ "topics": { "JCConf": [ { - "category": "JCConf", - "title": "Java 幼幼班 \uD83C\uDFAC 鐵人散步[30] 學習如何學習", - "url": "https://www.youtube.com/watch?v=wvPqfFj6hmM&list=PLRle6wVrCU6P7RtbWeeCEvl_BhkLUOc7x&index=30&ab_channel=TWJUG%E9%81%8A%E6%88%B2%E5%A0%B4", - "author": "鐵人場邊觀察家", - "profileUrl": "https://www.youtube.com/@twjug3281", - "anchor": "qrtt1", - "view": 5566, - "lastUpdated": 1663075172739, - "articles": [], - "status": "ONGOING" - }, - { - "category": "JCConf", - "title": "JCConf Taiwan 2023 \uD83E\uDD41 2023/10/06 (FRI) 9:00am \uD83E\uDD41 @台大醫院國際會議中心", - "url": "https://jcconf.tw/2023/", + "category": "Java 宇宙", + "title": "JCConf Taiwan 2024 \uD83E\uDD41 2024/09/27 (FRI) 9:00am \uD83E\uDD41 @台大醫院國際會議中心", + "url": "https://jcconf.tw/2024/", "author": "JVM 生態圈", - "profileUrl": "https://jcconf.tw/2023/", + "profileUrl": "https://jcconf.tw/2024/", "anchor": "jcconf", "view": 1000, "lastUpdated": 1663075172739, @@ -30,10 +18,10 @@ }, { "category": "JCConf", - "title": "2023 ITHOME 鐵人賽官方網站", - "url": "https://ithelp.ithome.com.tw/2023ironman/event", + "title": "2024 ITHOME 鐵人賽官方網站", + "url": "https://ithelp.ithome.com.tw/2024ironman/event", "author": "這裡是民間版觀賽區,不是 ITHOME 官方營運的呦。", - "profileUrl": "https://ithelp.ithome.com.tw/2023ironman/event", + "profileUrl": "https://ithelp.ithome.com.tw/2024ironman/event", "anchor": "notes", "view": 6666, "lastUpdated": 1663075172739, diff --git a/src/main/java/org/qty/crawler/DataUpdater.java b/src/main/java/org/qty/crawler/DataUpdater.java index 5818a7e..e08be5a 100644 --- a/src/main/java/org/qty/crawler/DataUpdater.java +++ b/src/main/java/org/qty/crawler/DataUpdater.java @@ -20,6 +20,10 @@ public static void main(String[] args) throws IOException { appendNewTopics(savedTopics, topics); } + savedTopics = new ArrayList<>(savedTopics.stream() + .collect(Collectors.toMap(t -> t.url, t -> t, (existing, replacement) -> existing)) + .values()); + Collections.sort(savedTopics, (a, b) -> { if (a.lastUpdated == b.lastUpdated) { return 0;