UNPKG

rsshub

Version:
55 lines (53 loc) 1.55 kB
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import "./logger-C4avouvV.mjs"; import { t as ofetch_default } from "./ofetch-DKl_Ma9g.mjs"; import { t as parseDate } from "./parse-date-r5WDWHno.mjs"; import { load } from "cheerio"; //#region lib/routes/google/jules.ts const route = { path: "/jules/changelog", categories: ["program-update"], example: "/google/jules/changelog", features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, name: "Jules Changelog", url: "jules.google/docs/changelog/", maintainers: ["johan456789"], handler }; async function handler() { const url = "https://jules.google/docs/changelog/"; const $ = load(await ofetch_default(url)); return { title: "Jules Changelog", link: url, item: $("main article").toArray().map((el) => { const article = $(el); const h2 = article.find("h2").first(); const id = h2.attr("id") || article.attr("id"); const title = h2.text().trim(); const anchor = id ? `${url}#${id}` : url; const pubDateText = h2.nextAll("b").first().text().trim(); const imgSrc = article.find("img").first().attr("src"); const image = imgSrc ? new URL(imgSrc, url).href : void 0; article.find("h2").first().remove(); article.find("b").first().remove(); return { title, description: article.html() || void 0, link: anchor, pubDate: pubDateText ? parseDate(pubDateText) : void 0, image }; }) }; } //#endregion export { route };