mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-14 17:19:37 +08:00
sspai matrix (#1432)
Add support for sspai matrix column [^1]. [^1] https://sspai.com/matrix
This commit is contained in:
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