diff --git a/server/glob.d.ts b/server/glob.d.ts index dab77e1..4c65b4c 100644 --- a/server/glob.d.ts +++ b/server/glob.d.ts @@ -14,6 +14,7 @@ declare module 'glob:./sources/{*.ts,**/index.ts}' { export const ghxi: typeof import('./sources/ghxi') export const github: typeof import('./sources/github') export const hackernews: typeof import('./sources/hackernews') + export const hupu: typeof import('./sources/hupu') export const ifeng: typeof import('./sources/ifeng') export const ithome: typeof import('./sources/ithome') export const jin10: typeof import('./sources/jin10') diff --git a/server/sources/hupu.ts b/server/sources/hupu.ts new file mode 100644 index 0000000..87445d5 --- /dev/null +++ b/server/sources/hupu.ts @@ -0,0 +1,20 @@ +interface Res { + data: { + title: string + hot: string + url: string + mobil_url: string + }[] +} + +export default defineSource(async () => { + const r: Res = await myFetch(`https://api.vvhan.com/api/hotlist/huPu`) + return r.data.map((k) => { + return { + id: k.url, + title: k.title, + url: k.url, + mobileUrl: k.mobil_url, + } + }) +}) diff --git a/shared/pinyin.json b/shared/pinyin.json index 445c1df..d511ca6 100644 --- a/shared/pinyin.json +++ b/shared/pinyin.json @@ -9,6 +9,7 @@ "wallstreetcn-hot": "huaerjiejianwen-zuirewenzhang", "36kr-quick": "36ke-kuaixun", "douyin": "douyin", + "hupu": "hupu-zhugandaoretie", "tieba": "baidutieba-reyi", "toutiao": "jinritoutiao", "ithome": "ITzhijia", diff --git a/shared/pre-sources.ts b/shared/pre-sources.ts index 82b7d1a..badee07 100644 --- a/shared/pre-sources.ts +++ b/shared/pre-sources.ts @@ -102,8 +102,11 @@ export const originSources = { }, "hupu": { name: "虎扑", - disable: true, home: "https://hupu.com", + column: "china", + title: "主干道热帖", + type: "hottest", + color: "red", }, "tieba": { name: "百度贴吧", diff --git a/shared/sources.json b/shared/sources.json index 5ac63fe..77ea5b0 100644 --- a/shared/sources.json +++ b/shared/sources.json @@ -116,6 +116,15 @@ "color": "gray", "interval": 600000 }, + "hupu": { + "title": "主干道热帖", + "name": "虎扑", + "type": "hottest", + "column": "china", + "home": "https://hupu.com", + "color": "red", + "interval": 600000 + }, "tieba": { "title": "热议", "name": "百度贴吧",