UNPKG

rsshub

Version:
36 lines (35 loc) 1.08 kB
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs"; import { t as parseDate } from "./parse-date-CjhZE69i.mjs"; import { load } from "cheerio"; //#region lib/routes/xclient/app.ts const route = { path: "/app/:name", categories: ["program-update"], example: "/xclient/app/sketch", parameters: { name: "应用名, 可在应用页 URL 中找到" }, name: "应用更新", maintainers: ["DIYgod"], handler }; async function handler(ctx) { const { name } = ctx.req.param(); const link = `http://xclient.info/s/${name}.html`; const $ = load(await rofetch(link)); return { title: $("title").text(), link, description: $("meta[name=\"description\"]").attr("content") || $("title").text(), item: $("#versions tbody tr").toArray().map((item) => { const td = $(item).find("td"); return { title: td.eq(0).text(), description: `版本号:${td.eq(0).text()}<br>更新日期:${td.eq(2).text()}<br>文件大小:${td.eq(3).text()}`, pubDate: parseDate(td.eq(2).text()), link, guid: td.eq(0).text() }; }) }; } //#endregion export { route };