UNPKG

rsshub

Version:
65 lines (63 loc) 2.09 kB
import "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import { t as ViewType } from "./types-D84BRIt4.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import "./ofetch-BIyrKU3Y.mjs"; import "./parse-date-BrP7mxXf.mjs"; import "./md5-C8GRvctM.mjs"; import "./helpers-DxBp0Pty.mjs"; import "./got-KxxWdaxq.mjs"; import "./timezone-D8cuwzTY.mjs"; import { t as handler } from "./cfh-CQcwvY-W.mjs"; import { t as handler$1 } from "./guba-CVesfXZD.mjs"; import { t as handler$2 } from "./trpl-DY9c2EOm.mjs"; //#region lib/routes/eastmoney/gerenzhongxin/gather.ts const route = { path: "/gerenzhongxin/gather/:uid", categories: ["finance"], view: ViewType.Articles, example: "/eastmoney/gerenzhongxin/gather/2922094262312522", parameters: { uid: "用户id,即用户主页网址末尾的数字" }, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [ { source: ["guba.eastmoney.com"] }, { source: ["caifuhao.eastmoney.com"] }, { source: ["i.eastmoney.com/:uid"], target: "/gerenzhongxin/gather/:uid" } ], name: "个人中心所有活动", maintainers: ["AwesomeDog"], handler: handler$3 }; async function handler$3(ctx) { const uid = ctx.req.param("uid"); const subCtx = { req: { param: (key) => key === "uid" ? uid : "" } }; const [cfhResult, gubaResult, trplResult] = await Promise.allSettled([ handler(subCtx), handler$1(subCtx), handler$2(subCtx) ]); const allItems = []; if (cfhResult.status === "fulfilled") allItems.push(...cfhResult.value.item); if (gubaResult.status === "fulfilled") allItems.push(...gubaResult.value.item); if (trplResult.status === "fulfilled") allItems.push(...trplResult.value.item); allItems.sort((a, b) => b.pubDate.getTime() - a.pubDate.getTime()); return { title: `${allItems[0]?.author || "用户"} 的东财所有活动`, link: `https://i.eastmoney.com/${uid}`, image: `https://avator.eastmoney.com/qface/${uid}/360`, item: allItems }; } //#endregion export { route };