UNPKG

rsshub

Version:
64 lines (62 loc) 1.98 kB
import { n as init_esm_shims, t as __dirname } from "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import "./ofetch-BIyrKU3Y.mjs"; import "./helpers-DxBp0Pty.mjs"; import { t as art } from "./render-BQo6B4tL.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import path from "node:path"; import { load } from "cheerio"; //#region lib/routes/amazon/kindle-software-updates.ts init_esm_shims(); const host = "https://www.amazon.com"; const route = { path: "/kindle/software-updates", categories: ["program-update"], example: "/amazon/kindle/software-updates", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: true, supportBT: false, supportPodcast: false, supportScihub: false }, name: "Kindle Software Updates", maintainers: ["EthanWng97"], handler }; async function handler() { const url = host + "/gp/help/customer/display.html"; const nodeIdValue = "GKMQC26VQQMM8XSW"; const data = (await got_default({ method: "get", url, searchParams: { nodeId: nodeIdValue } })).data; const $ = load(data); const list = $(".a-row.cs-help-landing-section.help-display-cond").toArray().map((item) => { return { title: $(item).find(".sectiontitle").text(), link: $(item).find("a").eq(0).attr("href"), version: $(item).find("li").first().text(), website: `${url}?nodeId=${nodeIdValue}`, description: $(item).find(".a-column.a-span8").html().replaceAll(/[\t\n]/g, "") }; }); return { title: "Kindle E-Reader Software Updates", link: `${url}?nodeId=${nodeIdValue}`, description: "Kindle E-Reader Software Updates", item: list.map((item) => ({ title: item.title + " - " + item.version, description: item.description + art(path.join(__dirname, "templates/software-description-6818ea1b.art"), { item }), guid: item.title + " - " + item.version, link: item.link })) }; } //#endregion export { route };