From 392a24c8171b7435c1aa7ddc0fdd66d998f79f73 Mon Sep 17 00:00:00 2001 From: Ou Date: Fri, 25 Oct 2024 22:08:02 +0800 Subject: [PATCH] chore: add kaopu.news --- public/icons/kaopu.png | Bin 0 -> 2923 bytes server/glob.d.ts | 1 + server/sources/kaopu.ts | 27 +++++++++++++++++++++++++++ shared/metadata.ts | 4 ++-- shared/sources.ts | 5 +++++ src/components/column/card.tsx | 2 +- 6 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 public/icons/kaopu.png create mode 100644 server/sources/kaopu.ts diff --git a/public/icons/kaopu.png b/public/icons/kaopu.png new file mode 100644 index 0000000000000000000000000000000000000000..c3ef43800eeb9cd65b91ec229bbca68ac7c2cf80 GIT binary patch literal 2923 zcmaJ@c{tSX79UHR?9tel?CWHiEDhNSMKNS7BkPb|WSwa2TNDY`HbTgfQ7HQ|gvK=d z2qAk7+4nW~+x_F-|Lz~>J?A~=JkR@{=bXXNvmfUvH?9_R5071o z7ar$z>YKO@d*mh_oSyRuk$0loySONNBrbO& zBTsZW;_P_O>hQKKwuFG@{JAfPWo=?uyBZ^)6O4VzU>yg&8M97J#aYK_8wQ@fKz+@H zyI~jbptb8$^ja1QT$MCm^s~b|_1t*{6XxK=uPsftgud@*i+j?vwz(j~SoGP=rCAR=9aORf zG1l@ODL2DBNi`a&vPKvOH~LH~qKT53ge3WepwYLMCLV^jW_-=B-~}}!N=i%5cFs4} zr<>Jhnu9l{J_V!+YAU}Yl!*2Y&zzsHj8q_+gS@e3jwP%C6mpR+5Y+I$whA+&D4fr)Mhm(!I=0`l2CTVWIJtHKtw?x8} zh6XlCwL!&iy&{nx{fd+k{@|dMI@d3U>9vjW%DQEKWv2OTV|pqLPfqq9v|;d#J~rO^ z$sD7DDBf%(&u`2BltunIwXP(DC7h9^*jo!4c%q))$x&<#KOlv<&U?5|H`U{~hRWZV z=9{K-Z%V!A*g%f3)3Y!<8@qj2|6X^t!*H5BI5Sh_ z9=k*ckaed^y~HBj_#{`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Z{JM;Z#c3&bbEqsdGVl>r?ke#C$*|ule-4ZveRYn4$wcxTa>id?X#{SNSN=Oi^LtkC1pYnh#5wJ2lUA zar^MHrAj{c`Ust6SqitSgr~O7L@v#ZSVP?4E6Ii#f2oGm$)vsjg%qf3f;9e|N2xPY zFbcl#OaPjp%i`6w5N>&ou2}NT>fnr^_nS>+T{js`UZE6YIq*B6OsTIix_CC=7^5Wf zjyF%_X+}~~^2wj(@)>L|=yTqhTkcnbA>3sYyW?3nIdxgT;8(rK4e8;c)i=osn)j=a zj%W06Q`S!XuCQua9#tWuPF}@haf*j(L9o`*WP$?-Xh_nUk%a_lVygoaPK+YjM`~ { + const url = "https://kaopucdn.azureedge.net/jsondata/news_list_beta_hans_0.json" + const res: Res = await $fetch(url) + return res + .slice(0, 30) + .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/metadata.ts b/shared/metadata.ts index 897e68f..7b70226 100644 --- a/shared/metadata.ts +++ b/shared/metadata.ts @@ -7,11 +7,11 @@ export const columnIds = ["focus", "realtime", "hottest", "china", "world", "tec const originMetadata: Metadata = { china: { name: "国内", - sources: ["zhihu", "thepaper"], + sources: ["zhihu", "thepaper", "douyin", "bilibili-hot-search", "weibo", "toutiao", "tieba"], }, world: { name: "国际", - sources: ["zaobao", "cankaoxiaoxi"], + sources: ["zaobao", "cankaoxiaoxi", "kaopu"], }, tech: { name: "科技", diff --git a/shared/sources.ts b/shared/sources.ts index 8ae2b6f..6d1b797 100644 --- a/shared/sources.ts +++ b/shared/sources.ts @@ -225,6 +225,11 @@ export const originSources = { }, }, }, + "kaopu": { + name: "靠谱新闻", + color: "gray", + home: "https://kaopu.news/", + }, } as const satisfies Record export const sources = genSources() diff --git a/src/components/column/card.tsx b/src/components/column/card.tsx index 1aa717a..0967973 100644 --- a/src/components/column/card.tsx +++ b/src/components/column/card.tsx @@ -143,7 +143,7 @@ function NewsCard({ id, inView, handleListeners }: NewsCardProps) { defer >
- {data?.items?.length && (sources[id].type === "hottest" ? : )} + {!!data?.items?.length && (sources[id].type === "hottest" ? : )}