UNPKG

rsshub

Version:
41 lines (40 loc) 1.26 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/noi/winners-list.ts const route = { path: "/winners-list", categories: ["other"], example: "/noi/winners-list", name: "获奖名单", maintainers: ["WenryXu"], handler }; async function handler() { const $ = load(await rofetch("https://www.noi.cn/hjmd/mdgs/")); const postList = $(".news-all .news-item").toArray(); return { title: "获奖名单 - NOI 全国青少年信息学奥林匹克竞赛", link: "https://www.noi.cn/hjmd/mdgs/", item: await Promise.all(postList.map((item) => { const $item = $(item); const title = $item.find("a").text(); const link = "https://www.noi.cn" + $item.find("a").attr("href"); const pubDate = timezone(parseDate($item.find("small").text()), 8); return cache_default.tryGet(link, async () => { const $detail = load(await rofetch(link)); return { title, link, guid: link, pubDate, description: $detail(".news-cont").html() }; }); })) }; } //#endregion export { route };