rsshub
Version:
Make RSS Great Again!
57 lines (55 loc) • 1.7 kB
JavaScript
import "./dist-Bog6z_OM.mjs";
import "./config-MQ-7ebJ_.mjs";
import "./logger-C4avouvV.mjs";
import "./ofetch-DKl_Ma9g.mjs";
import { t as parseDate } from "./parse-date-r5WDWHno.mjs";
import "./helpers-Bo4JQYdN.mjs";
import { t as got_default } from "./got-CO-ndVl2.mjs";
import { t as timezone } from "./timezone-CA9Huotp.mjs";
import { load } from "cheerio";
//#region lib/routes/nju/itsc.ts
const route = {
path: "/itsc",
categories: ["university"],
example: "/nju/itsc",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["itsc.nju.edu.cn/tzgg/list.htm"] }],
name: "ITSC 信息中心",
maintainers: ["ret-1"],
handler,
url: "itsc.nju.edu.cn/tzgg/list.htm"
};
async function handler() {
const category_dict = { tzgg: "通知公告" };
return {
title: "ITSC-公告通知",
link: "https://itsc.nju.edu.cn/tzgg/list.htm",
item: (await Promise.all(Object.keys(category_dict).map(async () => {
const data = (await got_default(`https://itsc.nju.edu.cn/tzgg/list.htm`)).data;
const $ = load(data);
const tmp = $(".list2")[0].children;
const infos = [];
for (const element of tmp) if (element.children) infos.push(element);
return infos.map((item) => {
item = $(item);
return {
title: item.find("a").attr("title"),
description: item.find("a").attr("title"),
link: "https://itsc.nju.edu.cn" + item.find("a").attr("href"),
pubDate: timezone(parseDate(item.find(".news_meta").text(), "YYYY-MM-DD"), 8),
category: category_dict[0]
};
});
})))[0]
};
}
//#endregion
export { route };