UNPKG

rsshub

Version:
48 lines (46 loc) 1.48 kB
import "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs"; import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import { load } from "cheerio"; //#region lib/routes/google/extension.ts const route = { path: "/chrome/extension/:id", categories: ["program-update"], example: "/google/chrome/extension/kefjpfngnndepjbopdmoebkipbgkggaa", parameters: { id: "Extension id, can be found in extension url" }, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["chromewebstore.google.com/detail/:name/:id"] }], name: "Extension Update", maintainers: ["DIYgod"], handler }; async function handler(ctx) { const id = ctx.req.param("id"); const $ = load(await ofetch_default(`https://chrome.google.com/webstore/detail/${id}?hl=en`)); const version = "v" + $(".nBZElf").text(); return { title: $(".Pa2dE").text() + " - Google Chrome Extension", link: `https://chrome.google.com/webstore/detail/${id}`, image: $(".rBxtY").attr("src"), item: [{ title: version, description: $(".JJ3H1e").html(), link: `https://chrome.google.com/webstore/detail/${id}`, pubDate: parseDate($(".uBIrad div").last().text()), guid: version, author: $(".cJI8ee").text() }] }; } //#endregion export { route };