UNPKG

rsshub

Version:
35 lines (34 loc) 994 B
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs"; import { t as parseDate } from "./parse-date-CjhZE69i.mjs"; import { load } from "cheerio"; //#region lib/routes/ghisler/whatsnew.ts const route = { path: "/whatsnew", categories: ["program-update"], example: "/ghisler/whatsnew", name: "What's New", maintainers: ["nczitzk"], handler }; async function handler() { const currentUrl = `http://ghisler.com/whatsnew.htm`; const $ = load((await rofetch(currentUrl)).replaceAll("<h3 align=\"left\">", "</content><content><h3 align=\"left\">")); const items = $("content").toArray().map((item) => { const $item = $(item); const title = $item.find("h3").text().replaceAll(/\s+/g, " "); return { link: currentUrl, guid: `${currentUrl}#${title}`, title, description: $item.find("p").html(), pubDate: parseDate($item.find("b").text().split(":", 1)[0]) }; }); return { title: $("title").text(), link: currentUrl, item: items }; } //#endregion export { route };