UNPKG

rsshub

Version:
48 lines (46 loc) 1.49 kB
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import "./logger-C4avouvV.mjs"; import "./ofetch-DKl_Ma9g.mjs"; import { t as parseDate } from "./parse-date-r5WDWHno.mjs"; import "./helpers-Bo4JQYdN.mjs"; import { t as got_default } from "./got-CO-ndVl2.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 };