rsshub
Version:
Make RSS Great Again!
58 lines (56 loc) • 1.65 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import { t as parseDate } from "./parse-date-BrP7mxXf.mjs";
import { t as cache_default } from "./cache-Bo__VnGm.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import { load } from "cheerio";
//#region lib/routes/typora/changelog.ts
const route = {
path: "/changelog",
categories: ["program-update"],
example: "/typora/changelog",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["support.typora.io/"] }],
name: "Changelog",
maintainers: ["cnzgray"],
handler,
url: "support.typora.io/"
};
async function handler() {
const host = "https://support.typora.io";
const { data } = await got_default(`${host}/store/`);
const list = Object.values(data).filter((i) => i.category === "new").map((i) => ({
title: i.title,
author: i.author,
description: i.content,
link: `${host}${i.url}`
}));
const items = await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => {
const { data: data$1 } = await got_default(item.link);
const $ = load(data$1);
item.pubDate = parseDate($(".post-meta time").text());
item.description = $("#post-content").html();
return item;
})));
return {
title: "Typora Changelog",
link: host,
description: "Typora Changelog",
image: `${host}/assets/img/favicon-128.png`,
item: items
};
}
//#endregion
export { route };