mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-19 03:09:14 +08:00
25 lines
666 B
TypeScript
25 lines
666 B
TypeScript
type Res = {
|
|
description: string
|
|
link: string
|
|
// Date
|
|
pubDate: string
|
|
publisher: string
|
|
title: string
|
|
}[]
|
|
export default defineSource(async () => {
|
|
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,
|
|
}
|
|
})
|
|
},
|
|
)
|