UNPKG

rsshub

Version:
44 lines (42 loc) 1.42 kB
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import "./logger-C4avouvV.mjs"; import "./ofetch-DKl_Ma9g.mjs"; import "./parse-date-r5WDWHno.mjs"; import "./is-worker-DESPicPc.mjs"; import "./cache-SV6W5EPy.mjs"; import "./helpers-Bo4JQYdN.mjs"; import { t as got_default } from "./got-CO-ndVl2.mjs"; import { t as utils_default } from "./utils-ATDruk-L.mjs"; //#region lib/routes/thepaper/sidebar.ts const sections = { hotNews: "澎湃热榜", financialInformationNews: "澎湃财讯", morningEveningNews: "早晚报" }; const route = { path: "/sidebar/:sec?", radar: [{ source: ["thepaper.cn/"], target: "/sidebar" }], name: "侧边栏", categories: ["new-media"], example: "/thepaper/sidebar", parameters: { sec: "侧边栏 id,可选 `hotNews` 即 澎湃热榜、`financialInformationNews` 即 澎湃财讯、`morningEveningNews` 即 早晚报,默认为 `hotNews`" }, maintainers: ["bigfei"], handler, url: "thepaper.cn/" }; async function handler(ctx) { const { sec = "hotNews" } = ctx.req.param(); const list = (await got_default(`https://cache.thepaper.cn/contentapi/wwwIndex/rightSidebar`)).data.data[sec]; const items = await Promise.all(list.filter((item) => item.contId).map((item) => utils_default.ProcessItem(item, ctx))); return { title: `澎湃新闻 - ${sections[sec]}`, item: items, link: "https://www.thepaper.cn" }; } //#endregion export { route };