rsshub
Version:
Make RSS Great Again!
49 lines (47 loc) • 1.53 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 "./helpers-DxBp0Pty.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
//#region lib/routes/sspai/shortcuts-gallery.ts
const route = {
path: "/shortcuts",
categories: ["new-media"],
example: "/sspai/shortcuts",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["shortcuts.sspai.com/*"] }],
name: "Shortcuts Gallery",
maintainers: ["Andiedie"],
handler,
url: "shortcuts.sspai.com/*"
};
async function handler() {
const { data: { data: categories } } = await got_default("https://shortcuts.sspai.com/api/v1/user/workflow/all/get");
const items = [];
for (const category of categories) for (const shortcut of category.data || []) items.push({
title: shortcut.name,
description: `作者:<a href="${shortcut.author_url || "#"}">${shortcut.author_id}</a><br/>${decodeURIComponent((shortcut.description || "").replaceAll("+", "%20"))}`,
pubDate: parseDate(shortcut.utime * 1e3),
guid: shortcut.id,
link: shortcut.url
});
return {
title: "Shortcuts Gallery - 少数派",
link: "https://shortcuts.sspai.com/#/main/workflow",
description: "Shortcuts Gallery - 少数派",
item: items
};
}
//#endregion
export { route };