UNPKG

rsshub

Version:
44 lines (43 loc) 1.19 kB
import { t as got_default } from "./got-BTowW50G.mjs"; import { t as getItems } from "./items-processor-CQcOY18x.mjs"; import { load } from "cheerio"; //#region lib/routes/publico/mujer.ts const route = { path: "/mujer/:subsection?", parameters: { subsection: { description: "Filter by subsection. Check the subsections available on the newspaper's website." } }, categories: ["traditional-media"], example: "/publico/mujer", features: { requireConfig: false, requirePuppeteer: true, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["publico.es/mujer"], target: "/mujer" }], name: "Mujer", maintainers: ["adrianrico97"], handler }; async function handler(ctx) { const { subsection } = ctx.req.param(); const rootUrl = "https://www.publico.es"; const currentUrl = subsection ? `${rootUrl}/mujer/${subsection}` : `${rootUrl}/mujer`; const $ = load((await got_default({ method: "get", url: currentUrl })).data); const title = $(".article-section h1").text(); const items = getItems($); return { title: `${title} | Público`, link: currentUrl, item: items }; } //#endregion export { route };