rsshub
Version:
Make RSS Great Again!
54 lines (52 loc) • 1.51 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import { t as parseDate } from "./parse-date-BrP7mxXf.mjs";
import { t as cache_default } from "./cache-Bo__VnGm.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import { load } from "cheerio";
//#region lib/routes/tynu/tynu.ts
const baseUrl = "http://www.tynu.edu.cn";
const route = {
path: "/",
radar: [{
source: [
"tynu.edu.cn/index/tzgg.htm",
"tynu.edu.cn/index.htm",
"tynu.edu.cn/"
],
target: ""
}],
name: "Unknown",
maintainers: ["2PoL"],
handler,
url: "tynu.edu.cn/index/tzgg.htm"
};
async function handler() {
const link = `${baseUrl}/index/tzgg.htm`;
const data = (await got_default(link)).data;
const $ = load(data);
const list = $(".news_content_list").toArray().map((item) => {
item = $(item);
return {
title: item.find("h3").text(),
link: new URL(item.find($("a")).attr("href"), baseUrl).href,
pubDate: parseDate(item.find(".content_list_time").text(), "YYYYMM-DD")
};
});
await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => {
const $$1 = load((await got_default(item.link)).data);
item.description = $$1("#vsb_content").html() + ($$1(".content ul").not(".btm-cate").html() || "");
return item;
})));
return {
title: "太原师范学院通知公告",
link,
item: list
};
}
//#endregion
export { route };