UNPKG

rsshub

Version:
39 lines (38 loc) 962 B
import { t as rofetch } from "./ofetch-U0CdpE2g.mjs"; import { n as fetchFullArticles, r as rootUrl } from "./utils-DDwRpto7.mjs"; import { load } from "cheerio"; //#region lib/routes/yicai/carousel.ts const route = { path: "/carousel", categories: ["traditional-media"], example: "/yicai/carousel", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["yicai.com/"] }], name: "轮播", maintainers: ["nczitzk"], handler, url: "yicai.com/" }; async function handler() { const res = await rofetch(rootUrl); const $ = load(res); const items = await Promise.all(fetchFullArticles($("#breaknews a").toArray().map((e) => ({ link: new URL($(e).attr("href"), rootUrl).href, title: $(e).text() })))); return { title: "第一财经 - 轮播", link: rootUrl, item: items }; } //#endregion export { route };