UNPKG

rsshub

Version:
56 lines (54 loc) 1.59 kB
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 "./helpers-DxBp0Pty.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import { load } from "cheerio"; //#region lib/routes/tongji/bks.ts const route = { path: "/bks", categories: ["university"], example: "/tongji/bks", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["bksy.tongji.edu.cn/"] }], name: "本科生院通知公告", maintainers: ["shiquda"], handler, url: "bksy.tongji.edu.cn/" }; async function handler() { const link = "https://bksy.tongji.edu.cn/30359/list.htm"; const $ = load((await got_default(link)).data); return { title: "同济大学本科生院", link, description: "同济大学本科生院通知公告", item: $(".wcts-a0018 li")?.toArray().map((item) => { item = $(item); const a = item.find("a"); const dateItem = item.find(".li-data"); const yearAndMonth = dateItem.find("span").text().split("-"); const day = dateItem.find("p").text(); const date = `${yearAndMonth[0]}-${yearAndMonth[1]}-${day}`; return { title: item.find(".li-tt-title").text(), description: item.find(".intro").text(), link: new URL(a.attr("href"), link).href, pubDate: parseDate(date, "YYYY-MM-DD") }; }) }; } //#endregion export { route };