UNPKG

rsshub

Version:
37 lines (35 loc) 961 B
import "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs"; import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import { load } from "cheerio"; //#region lib/routes/njuferret/blog.ts const route = { path: "/blog", categories: ["blog"], example: "/njuferret/blog", radar: [{ source: ["njuferret.github.io"] }], name: "Blogs", maintainers: ["tyl0622"], handler }; async function handler() { const baseUrl = "https://njuferret.github.io"; const $ = load(await ofetch_default(baseUrl)); return { title: "njuferret - blog", item: $("div.post-block").toArray().map((item) => { item = $(item); const a = item.find("a").first(); return { title: a.text(), link: `${baseUrl}${a.attr("href")}`, pubDate: parseDate(item.find("time").attr("datetime")) }; }) }; } //#endregion export { route };