rsshub
Version:
Make RSS Great Again!
42 lines (41 loc) • 1.34 kB
JavaScript
import { t as parseDate } from "./parse-date-Cr0wQjV_.mjs";
import { t as cache_default } from "./cache-BkqOokyU.mjs";
import { t as got_default } from "./got-BTowW50G.mjs";
import { t as timezone } from "./timezone-BBvDwS_3.mjs";
import { load } from "cheerio";
//#region lib/routes/ecnu/phy.ts
const route = {
path: "/phy",
categories: ["university"],
example: "/ecnu/phy",
radar: [{
source: ["phy.ecnu.edu.cn"],
target: "/phy"
}],
name: "物理与电子科学学院通知公告",
maintainers: [
"FrozenStarrrr",
"ChiyoYuki",
"ECNU-minus"
],
handler: async () => {
const baseUrl = "https://phy.ecnu.edu.cn/";
const $ = load((await got_default(`${baseUrl}1605/list.htm`)).data);
const links = $("ul.data-list > li").toArray().map((el) => ({
pubDate: timezone(parseDate($(el).find("span").text()), 8),
link: new URL($(el).find("a").attr("href"), baseUrl).href,
title: $(el).find("a").attr("title")
}));
return {
title: "物理与电子科学学院通知公告",
link: "https://phy.ecnu.edu.cn/1605/list.htm",
item: await Promise.all(links.map((item) => cache_default.tryGet(item.link, async () => {
const { data } = await got_default(item.link);
item.description = load(data)("div.wp_articlecontent").html()?.trim();
return item;
})))
};
}
};
//#endregion
export { route };