rsshub
Version:
Make RSS Great Again!
56 lines (54 loc) • 1.59 kB
JavaScript
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/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 };