UNPKG

rsshub

Version:
42 lines (41 loc) 1.26 kB
import { t as config } from "./config-BfTrYkQS.mjs"; import { t as parseDate } from "./parse-date-3kcy2Eau.mjs"; import { t as cache_default } from "./cache-C1Y-9qDV.mjs"; import { t as got_default } from "./got-DUpa1V3-.mjs"; import { load } from "cheerio"; //#region lib/routes/fishshell/index.ts const route = { path: "/", categories: ["program-update"], example: "/fishshell", radar: [{ source: ["fishshell.com/"], target: "" }], name: "Release Notes", maintainers: ["x2cf"], handler, url: "fishshell.com/" }; async function handler() { const link = "https://fishshell.com/docs/current/relnotes.html"; const data = await cache_default.tryGet(link, async () => (await got_default(link)).data, config.cache.contentExpire, false); const $ = load(data); 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 };