rsshub
Version:
Make RSS Great Again!
36 lines (34 loc) • 926 B
JavaScript
import "./dist-Bog6z_OM.mjs";
import "./config-MQ-7ebJ_.mjs";
import "./logger-C4avouvV.mjs";
import { t as ofetch_default } from "./ofetch-DKl_Ma9g.mjs";
import { t as parseDate } from "./parse-date-r5WDWHno.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 };