rsshub
Version:
Make RSS Great Again!
67 lines (65 loc) • 1.85 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 "./is-worker-DESPicPc.mjs";
import { t as cache_default } from "./cache-SV6W5EPy.mjs";
import "./helpers-Bo4JQYdN.mjs";
import { t as got_default } from "./got-CO-ndVl2.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 = colsTitle.attr("href");
const title = colsTitle.text();
const pubDate = parseDate(colsMeta.text(), "YYYY-MM-DD", "zh-cn");
const url = `${siteUrl}${link}`;
return await cache_default.tryGet(url, async () => {
let description = "";
try {
const { data: response } = await got_default(url);
description = load(response)(".wp_articlecontent").first().html() ?? "";
} catch {
description = "";
}
return {
title,
link,
pubDate,
description
};
});
}))
};
}
//#endregion
export { route };