rsshub
Version:
Make RSS Great Again!
56 lines (54 loc) • 1.81 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 { t as timezone } from "./timezone-D8cuwzTY.mjs";
import { load } from "cheerio";
//#region lib/routes/szftedu/dongtai.ts
const host = "https://ylxx.szftedu.cn/xx_5828/xydt_5829/bxfbx_6371/";
const baseLink = "https://ylxx.szftedu.cn";
const route = {
path: "/dongtai",
categories: ["university"],
example: "/szftedu/dongtai",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
name: "动态",
maintainers: ["valuex"],
handler,
description: ""
};
async function handler() {
const $ = load((await got_default(host)).data);
const lists = $("div.pagenews04 div ul li").toArray().map((el) => ({
title: $("a", el).text().trim(),
link: $("a", el).attr("href"),
pubDate: timezone(parseDate($("span[class=canedit]", el).text()), 8)
}));
return {
title: "园岭小学动态",
link: host,
description: "园岭小学动态",
item: await Promise.all(lists.map((item) => cache_default.tryGet(item.link, async () => {
const thisUrl = item.link;
const $$1 = load((await got_default(thisUrl.includes("http") ? thisUrl : baseLink + thisUrl)).data);
item.description = thisUrl.includes("http") ? $$1("#page-content").html() : $$1("div.TRS_Editor").html();
item.pubDate = timezone(parseDate($$1("#publish_time").first().text()), 8);
return item;
})))
};
}
//#endregion
export { route };