chore: minor changes

This commit is contained in:
Ou 2024-10-27 17:11:59 +08:00
parent 62344a33ae
commit 76c282f302
2 changed files with 16 additions and 18 deletions

View File

@ -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<Res>))
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,
}
})
},
)

View File

@ -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<string, OriginSource>