UNPKG

rsshub

Version:
53 lines (52 loc) 1.51 kB
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs"; import { t as parseDate } from "./parse-date-CjhZE69i.mjs"; import { t as cache_default } from "./cache-CiDoUSLo.mjs"; import { t as timezone } from "./timezone-DE--ze1V.mjs"; import { load } from "cheerio"; //#region lib/routes/ynnu/edu/news.ts const route = { path: "/edu/news", categories: ["university"], example: "/ynnu/edu/news", radar: [{ source: ["jxjy.ynnu.edu.cn/index/:category.htm"], target: "/edu/news" }], name: "继续教育学院 - 新闻", maintainers: ["SettingDust"], handler, url: "jxjy.ynnu.edu.cn" }; async function handler() { const baseUrl = "https://jxjy.ynnu.edu.cn"; const lists = await Promise.all([ "xwdt", "tzgg", "pxdt" ].map(async (category) => { const link = `${baseUrl}/index/${category}.htm`; const $ = load(await rofetch(link)); return $(".text-list li a").toArray().map((item) => { const $item = $(item); return { title: $item.find("h3").text(), link: new URL($item.attr("href"), link).href }; }); })); return { title: "云南师范大学继续教育学院 #通知", link: baseUrl, language: "zh-CN", item: await Promise.all(lists.flat().map((item) => cache_default.tryGet(item.link, async () => { const $ = load(await rofetch(item.link)); return { ...item, pubDate: timezone(parseDate($(".art-tit p span").text(), "发布日期:YYYY-MM-DD"), 8), description: $(".v_news_content").html() }; }))) }; } //#endregion export { route };