rsshub
Version:
Make RSS Great Again!
47 lines (46 loc) • 1.36 kB
JavaScript
import { t as rofetch } from "./ofetch-C3ts-Hud.mjs";
import { n as resolveArticles, t as parsePubDate } from "./utils-BSBnI7AV.mjs";
import { load } from "cheerio";
//#region lib/routes/njxzc/lib.ts
const pageUrl = "https://lib.njxzc.edu.cn/pxyhd/list.htm";
const route = {
path: "/libtzgg",
categories: ["university"],
example: "/njxzc/libtzgg",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["lib.njxzc.edu.cn/pxyhd/list.htm", "lib.njxzc.edu.cn/"] }],
name: "图书馆通知公告",
maintainers: ["real-jiakai"],
handler,
url: "lib.njxzc.edu.cn/pxyhd/list.htm"
};
async function handler() {
const $ = load(await rofetch(pageUrl));
const list = $("a.btt-2").toArray().map((el) => {
const $link = $(el);
const href = $link.attr("href");
if (!href) return null;
const day = $link.find(".tm-1").text();
const yearMonth = $link.find(".tm-2").text();
return {
title: $link.find(".btt-4").text().trim(),
link: new URL(href, pageUrl).href,
pubDate: parsePubDate(`${yearMonth}-${day}`)
};
}).filter((item) => item !== null);
return {
title: "南京晓庄学院 -- 图书馆通知公告",
link: pageUrl,
item: await resolveArticles(list)
};
}
//#endregion
export { route };