UNPKG

rsshub

Version:
57 lines (55 loc) 1.77 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 { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs"; import { t as cache_default } from "./cache-Bo__VnGm.mjs"; import { t as rss_parser_default } from "./rss-parser-Dtop7M8f.mjs"; import { load } from "cheerio"; //#region lib/routes/magnumphotos/magazine.ts const host = "https://www.magnumphotos.com"; const route = { path: "/magazine", categories: ["picture"], view: ViewType.Pictures, example: "/magnumphotos/magazine", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["magnumphotos.com/"] }], name: "Magazine", maintainers: ["EthanWng97"], handler, url: "magnumphotos.com/" }; async function handler() { const rssUrl = `${host}/feed/`; const feed = await rss_parser_default.parseURL(rssUrl); return { title: "Magnum Photos", link: host, description: "Magnum is a community of thought, a shared human quality, a curiosity about what is going on in the world, a respect for what is going on and a desire to transcribe it visually", item: await Promise.all(feed.items.map((item) => cache_default.tryGet(item.link, async () => { if (!item.link) return; const description = load(await ofetch_default(item.link))("#content"); description.find("ul.share").remove(); description.find("h1").remove(); return { title: item.title, pubDate: item.pubDate, link: item.link, category: item.categories, description: description.html() }; }))) }; } //#endregion export { route };