UNPKG

rsshub

Version:
40 lines (39 loc) 1.06 kB
import { t as parseDate } from "./parse-date-3kcy2Eau.mjs"; import { t as got_default } from "./got-DUpa1V3-.mjs"; import { load } from "cheerio"; //#region lib/routes/quicker/versions.ts const route = { path: "/versions", categories: ["program-update"], example: "/quicker/versions", name: "版本更新", maintainers: ["Cesaryuan", "nczitzk"], handler, url: "getquicker.net/Help/Versions" }; async function handler() { const rootUrl = "https://getquicker.net"; const currentUrl = `${rootUrl}/Help/Versions`; const response = await got_default({ method: "get", url: currentUrl }); const $ = load(response.data); const items = $(".version").toArray().map((item) => { const $item = $(item); const a = $item.find("h2 a"); return { title: a.text().trim(), link: `${rootUrl}${a.attr("href")}`, description: $item.find(".article-content").html(), pubDate: parseDate($item.find(".text-secondary").first().text()) }; }); return { title: $("title").text(), link: currentUrl, item: items }; } //#endregion export { route };