rsshub
Version:
Make RSS Great Again!
33 lines (32 loc) • 1.06 kB
JavaScript
import { t as rofetch } from "./ofetch-U0CdpE2g.mjs";
import { load } from "cheerio";
//#region lib/routes/thunderbird/release.ts
const route = {
path: "/release",
categories: ["program-update"],
example: "/thunderbird/release",
name: "Changelog",
maintainers: ["garywill"],
handler
};
async function handler() {
const releasesResponse = await rofetch("https://www.thunderbird.net/en-US/thunderbird/releases/");
const version = load(releasesResponse)(".release-container").first().find("a").last().text();
const notesResponse = await rofetch(`https://www.thunderbird.net/en-US/thunderbird/${version}/releasenotes/`);
const $ = load(notesResponse);
$("main section").last().remove();
$("main svg").remove();
const content = $("main").html();
return {
title: "Thunderbird release note",
link: "https://www.thunderbird.net/",
item: [{
title: `Thunderbird ${version} release`,
guid: version,
link: `https://www.thunderbird.net/en-US/thunderbird/${version}/releasenotes`,
description: content
}]
};
}
//#endregion
export { route };