rsshub
Version:
Make RSS Great Again!
67 lines (65 loc) • 1.87 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/dhu/xxgk/news.ts
const siteUrl = "https://xxgk.dhu.edu.cn";
const baseUrl = "https://xxgk.dhu.edu.cn/1737/list.htm";
const route = {
path: "/xxgk/news",
categories: ["university"],
example: "/dhu/xxgk/news",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
name: "最新信息公开",
maintainers: ["KiraKiseki"],
handler
};
async function handler() {
const link = baseUrl;
const { data: response } = await got_default(link);
const $ = load(response);
return {
title: "东华大学信息公开网-最新公开信息",
link,
item: await Promise.all($(".cols_list > li").toArray().map(async (item) => {
item = $(item);
const colsTitle = item.find(".cols_title > a");
const colsMeta = item.find(".cols_meta");
const link$1 = colsTitle.attr("href");
const title = colsTitle.text();
const pubDate = parseDate(colsMeta.text(), "YYYY-MM-DD", "zh-cn");
const url = `${siteUrl}${link$1}`;
return await cache_default.tryGet(url, async () => {
let description = "";
try {
const { data: response$1 } = await got_default(url);
description = load(response$1)(".wp_articlecontent").first().html() ?? "";
} catch {
description = "";
}
return {
title,
link: link$1,
pubDate,
description
};
});
}))
};
}
//#endregion
export { route };