UNPKG

rsshub

Version:
37 lines (36 loc) 1.21 kB
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs"; import { t as parseDate } from "./parse-date-CjhZE69i.mjs"; import { t as timezone } from "./timezone-DE--ze1V.mjs"; import { load } from "cheerio"; //#region lib/routes/qq/weixin/miniprogram/framework.ts const route = { path: "/weixin/miniprogram/framework", categories: ["programming"], example: "/qq/weixin/miniprogram/framework", name: "基础库更新日志", maintainers: ["magicLaLa", "nczitzk"], handler }; async function handler() { const link = "https://developers.weixin.qq.com/miniprogram/dev/framework/release/"; const $ = load(await rofetch(link)); const name = $("#docContent .content h1").text().replaceAll(/[\s#|]/g, ""); return { title: name, link, item: $("#docContent .content h2").toArray().map((item) => { const $item = $(item); const title = $item.text().replaceAll(/[\s#|]/g, ""); const date = /\d{4}[.-]\d{2}[.-]\d{2}/.exec(title)?.[0]; return { title, description: $item.next().html(), pubDate: date ? timezone(parseDate(date.replaceAll(".", "-")), 8) : void 0, link: link + $item.find("a.header-anchor").attr("href") }; }), description: name }; } //#endregion export { route };