diff --git a/docs/README.md b/docs/README.md index e168a6d48..96e13a47d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1641,6 +1641,8 @@ IATA 国际航空运输协会机场代码, 参见[维基百科 国际航空运 + + ### 电影首发站 diff --git a/router.js b/router.js index a82f40bb2..ad042675b 100644 --- a/router.js +++ b/router.js @@ -560,6 +560,7 @@ router.get('/douyin/user/:id', require('./routes/douyin/user')); // 少数派 sspai router.get('/sspai/series', require('./routes/sspai/series')); +router.get('/sspai/shortcuts', require('./routes/sspai/shortcutsGallery')); // xclient.info router.get('/xclient/app/:name', require('./routes/xclient/app')); diff --git a/routes/sspai/shortcutsGallery.js b/routes/sspai/shortcutsGallery.js new file mode 100644 index 000000000..06a7be734 --- /dev/null +++ b/routes/sspai/shortcutsGallery.js @@ -0,0 +1,28 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const { + data: { data: categories }, + } = await axios.get('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: `作者:${shortcut.author_id}
${decodeURIComponent((shortcut.description || '').replace(/\+/g, '%20'))}`, + pubDate: new Date(shortcut.utime * 1000).toUTCString(), + guid: shortcut.id, + link: shortcut.url, + }); + } + } + + ctx.state.data = { + title: 'Shortcuts Gallery - 少数派', + link: 'https://shortcuts.sspai.com/#/main/workflow', + description: 'Shortcuts Gallery - 少数派', + item: items, + }; +};