UNPKG

rsshub

Version:
45 lines (43 loc) 1.34 kB
import "./dist-Bog6z_OM.mjs"; import { t as config } from "./config-MQ-7ebJ_.mjs"; import "./logger-C4avouvV.mjs"; import "./ofetch-DKl_Ma9g.mjs"; import { t as parseDate } from "./parse-date-r5WDWHno.mjs"; import "./is-worker-DESPicPc.mjs"; import { t as cache_default } from "./cache-SV6W5EPy.mjs"; import "./helpers-Bo4JQYdN.mjs"; import { t as got_default } from "./got-CO-ndVl2.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 };