rsshub
Version:
Make RSS Great Again!
46 lines (45 loc) • 1.29 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/home.ts
const pageUrl = "https://www.njxzc.edu.cn/89/list.htm";
const route = {
path: "/tzgg",
categories: ["university"],
example: "/njxzc/tzgg",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["www.njxzc.edu.cn/89/list.htm", "www.njxzc.edu.cn/"] }],
name: "官网通知公告",
maintainers: ["real-jiakai"],
handler,
url: "www.njxzc.edu.cn/89/list.htm"
};
async function handler() {
const $ = load(await rofetch(pageUrl));
const list = $(".news_list .news").toArray().map((el) => {
const $item = $(el);
const $link = $item.find("a");
const href = $link.attr("href");
if (!href) return null;
return {
title: $link.attr("title") || $link.text(),
link: new URL(href, pageUrl).href,
pubDate: parsePubDate($item.find(".news_meta").text())
};
}).filter((item) => item !== null);
return {
title: "南京晓庄学院 -- 通知公告",
link: pageUrl,
item: await resolveArticles(list)
};
}
//#endregion
export { route };