rsshub
Version:
Make RSS Great Again!
41 lines (40 loc) • 1.27 kB
JavaScript
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs";
import { t as parseDate } from "./parse-date-CjhZE69i.mjs";
import { t as cache_default } from "./cache-CiDoUSLo.mjs";
import { t as timezone } from "./timezone-DE--ze1V.mjs";
import { load } from "cheerio";
//#region lib/routes/gdou/jwtz.ts
const route = {
path: "/jwc",
categories: ["university"],
example: "/gdou/jwc",
radar: [{ source: ["jwc.gdou.edu.cn/jwdt/jwtz.htm"] }],
name: "教务通知",
maintainers: ["Xiaotouming"],
handler,
url: "jwc.gdou.edu.cn/jwdt/jwtz.htm"
};
async function handler() {
const link = "https://jwc.gdou.edu.cn/jwdt/jwtz.htm";
const $ = load(await rofetch(link));
const list = $("li[id^=\"line_u8_\"] a").slice(0, 10).toArray().map((item) => {
const $item = $(item);
return {
title: $item.find("em").text(),
link: new URL($item.attr("href"), link).href,
pubDate: timezone(parseDate($item.find("span").text(), "YYYY-MM-DD"), 8),
author: "教务部"
};
});
const items = await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => {
item.description = load(await rofetch(item.link))(".v_news_content").html();
return item;
})));
return {
title: $("head title").text(),
link,
item: items
};
}
//#endregion
export { route };