UNPKG

rsshub

Version:
49 lines (47 loc) 1.37 kB
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import "./logger-C4avouvV.mjs"; import { t as ofetch_default } from "./ofetch-DKl_Ma9g.mjs"; import { t as parseDate } from "./parse-date-r5WDWHno.mjs"; import { load } from "cheerio"; //#region lib/routes/flashcat/blog.ts const route = { path: "/blog", categories: ["blog"], example: "/flashcat/blog", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["flashcat.cloud/blog"], target: "/blog" }], name: "快猫星云博客", maintainers: ["chesha1"], handler: handlerRoute }; async function handlerRoute() { const $ = load(await ofetch_default("https://flashcat.cloud/blog/")); return { title: "Flashcat 快猫星云博客", link: "https://flashcat.cloud/blog/", item: $(".post-preview").toArray().map((elem) => { const $elem = $(elem); return { title: $elem.find(".post-title").text(), description: $elem.find(".post-content-preview").text(), link: $elem.find("a").attr("href"), pubDate: parseDate($elem.find(".post-meta").text().match(/on\s+(\w+,\s+\w+\s+\d{1,2},\s+\d{4})/)?.[1] || ""), author: $elem.find(".post-meta").text().match(/by\s+(.+?)\s+on/)?.[1] || "" }; }) }; } //#endregion export { route };