rsshub
Version:
Make RSS Great Again!
50 lines (48 loc) • 1.46 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 { t as cache_default } from "./cache-Bo__VnGm.mjs";
import { load } from "cheerio";
//#region lib/routes/raycast/changelog.ts
const handler = async () => {
return {
title: "Raycast Changelog",
link: "https://www.raycast.com/changelog",
language: "en-US",
item: await cache_default.tryGet("raycast:changelog", async () => {
return load(await ofetch_default("https://www.raycast.com/changelog"))("article").toArray().map((item) => {
const $ = load(item);
const version = $("span[id]").attr("id");
const html = $("div.markdown").html() ?? "";
const date = $("span[class^=ChangelogEntry_changelogDate]").text().trim();
return {
title: `Version ${version}`,
description: html,
link: `https://www.raycast.com/changelog/${version?.replaceAll(".", "-")}`,
pubDate: parseDate(date)
};
});
})
};
};
const route = {
path: "/changelog",
name: "Changelog",
categories: ["program-update"],
example: "/raycast/changelog",
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
handler,
maintainers: ["equt"]
};
//#endregion
export { route };