UNPKG

rsshub

Version:
45 lines (43 loc) 1.34 kB
import "./esm-shims-CzJ_djXG.mjs"; import { t as config } from "./config-C37vj7VH.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import "./ofetch-BIyrKU3Y.mjs"; import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import { t as cache_default } from "./cache-Bo__VnGm.mjs"; import "./helpers-DxBp0Pty.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import { load } from "cheerio"; //#region lib/routes/fishshell/index.ts const route = { path: "/", radar: [{ source: ["fishshell.com/"], target: "" }], name: "Unknown", maintainers: ["x2cf"], handler, url: "fishshell.com/" }; async function handler() { const link = "https://fishshell.com/docs/current/relnotes.html"; const $ = load(await cache_default.tryGet(link, async () => (await got_default(link)).data, config.cache.contentExpire, false)); return { link, title: "Release notes — fish-shell", language: "en", item: $("#release-notes > section").toArray().map((item) => { const title = $(item).find("h2").contents().first().text(); const date = title.match(/\(released (.+?)\)/)?.[1]; return { title, link: new URL($(item).find("a").attr("href"), link).href, pubDate: date ? parseDate(date, "MMMM D, YYYY") : void 0, description: $(item).html() }; }) }; } //#endregion export { route };