From 76c282f302c6ab40be8b2a3be85b33165922428e Mon Sep 17 00:00:00 2001 From: Ou Date: Sun, 27 Oct 2024 17:11:59 +0800 Subject: [PATCH] chore: minor changes --- server/sources/kaopu.ts | 28 +++++++++++++--------------- shared/sources.ts | 6 +++--- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/server/sources/kaopu.ts b/server/sources/kaopu.ts index b134d47..181fa76 100644 --- a/server/sources/kaopu.ts +++ b/server/sources/kaopu.ts @@ -7,20 +7,18 @@ type Res = { title: string }[] export default defineSource(async () => { - const url = "https://kaopucdn.azureedge.net/jsondata/news_list_beta_hans_0.json" - const res: Res = await $fetch(url) - return res.filter(k => ["财新", "公视"].every(h => k.publisher !== h)) - .map((k) => { - return { - id: k.link, - title: k.title, - pubDate: k.pubDate, - extra: { - hover: k.description, - info: k.publisher, - }, - url: k.link, - } - }) + const res = await Promise.all(["https://kaopucdn.azureedge.net/jsondata/news_list_beta_hans_0.json", "https://kaopucdn.azureedge.net/jsondata/news_list_beta_hans_1.json"].map(url => $fetch(url) as Promise)) + return res.flat().filter(k => ["财新", "公视"].every(h => k.publisher !== h)).map((k) => { + return { + id: k.link, + title: k.title, + pubDate: k.pubDate, + extra: { + hover: k.description, + info: k.publisher, + }, + url: k.link, + } + }) }, ) diff --git a/shared/sources.ts b/shared/sources.ts index a8f8d3d..9ee62f1 100644 --- a/shared/sources.ts +++ b/shared/sources.ts @@ -240,8 +240,6 @@ export const originSources = { name: "哔哩哔哩", color: "blue", home: "https://www.bilibili.com", - // cloudflare pages cannot access - // disable: true, sub: { "hot-search": { title: "热搜", @@ -256,13 +254,14 @@ export const originSources = { column: "china", color: "orange", // cloudflare pages cannot access - disable: true, + // disable: true, home: "https://www.kuaishou.com", }, "kaopu": { name: "靠谱新闻", column: "world", color: "gray", + interval: Time.Common, desc: "不一定靠谱,多看多思考", home: "https://kaopu.news/", }, @@ -270,6 +269,7 @@ export const originSources = { name: "金十数据", column: "finance", color: "blue", + type: "realtime", home: "https://www.jin10.com", }, } as const satisfies Record