mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-19 03:09:14 +08:00
30 lines
637 B
TypeScript
30 lines
637 B
TypeScript
interface Res {
|
|
data: {
|
|
ClusterIdStr: string
|
|
Title: string
|
|
HotValue: string
|
|
Image: {
|
|
url: string
|
|
}
|
|
LabelUri?: {
|
|
url: string
|
|
}
|
|
}[]
|
|
}
|
|
|
|
export default defineSource(async () => {
|
|
const url = "https://www.toutiao.com/hot-event/hot-board/?origin=toutiao_pc"
|
|
const res: Res = await myFetch(url)
|
|
return res.data
|
|
.map((k) => {
|
|
return {
|
|
id: k.ClusterIdStr,
|
|
title: k.Title,
|
|
url: `https://www.toutiao.com/trending/${k.ClusterIdStr}/`,
|
|
extra: {
|
|
icon: k.LabelUri?.url && proxyPicture(k.LabelUri.url, "encodeBase64URL"),
|
|
},
|
|
}
|
|
})
|
|
})
|