Skip to content

Commit

Permalink
Update extra-info and enable auto-update
Browse files Browse the repository at this point in the history
Signed-off-by: Ching Yi, Chan <[email protected]>
  • Loading branch information
qrtt1 committed Aug 4, 2024
1 parent f771e04 commit 111f988
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 40 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
24 changes: 6 additions & 18 deletions dashboard/src/extra.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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 中文討論區",
Expand Down
26 changes: 7 additions & 19 deletions dashboard/src/jcconf.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/qty/crawler/DataUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 111f988

Please sign in to comment.