mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-15 10:15:23 +08:00
sspai matrix (#1432)
Add support for sspai matrix column [^1]. [^1] https://sspai.com/matrix
This commit is contained in:
@@ -2610,6 +2610,8 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的
|
||||
|
||||
<route name="Shortcuts Gallery" author="Andiedie" example="/sspai/shortcuts" path="/sspai/shortcuts" />
|
||||
|
||||
<route name="Matrix" author="feigaoxyz" example="/sspai/matrix" path="/sspai/matrix" />
|
||||
|
||||
### 趣头条
|
||||
|
||||
<route name="分类" author="alphardex" example="/qutoutiao/category/1" path="/qutoutiao/category/:cid" :paramsDesc="['分类 id']">
|
||||
|
||||
@@ -722,6 +722,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'));
|
||||
router.get('/sspai/matrix', require('./routes/sspai/matrix'));
|
||||
|
||||
// xclient.info
|
||||
router.get('/xclient/app/:name', require('./routes/xclient/app'));
|
||||
|
||||
23
lib/routes/sspai/matrix.js
Normal file
23
lib/routes/sspai/matrix.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const axios = require('../../utils/axios');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const api_url = 'https://sspai.com/api/v1/articles?offset=0&limit=20&is_matrix=1&sort=matrix_at&include_total=false';
|
||||
const resp = await axios({
|
||||
method: 'get',
|
||||
url: api_url,
|
||||
});
|
||||
const data = resp.data.list;
|
||||
|
||||
ctx.state.data = {
|
||||
title: '少数派 -- Matrix',
|
||||
link: 'https://sspai.com/matrix',
|
||||
description: '少数派 -- Matrix',
|
||||
item: data.map((item) => ({
|
||||
title: item.title.trim(),
|
||||
description: item.summary.trim(),
|
||||
link: `https://sspai.com/post/${item.id}`,
|
||||
pubDate: new Date(item.released_at * 1000).toUTCString(),
|
||||
author: item.author.nickname,
|
||||
})),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user