mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-02 01:58:11 +08:00
25 lines
737 B
JavaScript
25 lines
737 B
JavaScript
const got = require('@/utils/got');
|
|
const { parseDate } = require('@/utils/parse-date');
|
|
|
|
module.exports = async (ctx) => {
|
|
const api = 'https://www.secrss.com/api/articles/group?author=';
|
|
const author = ctx.params.author;
|
|
const host = 'https://www.secrss.com';
|
|
const res = await got(`${api}${author}`);
|
|
const dataArray = res.data.data.list;
|
|
|
|
const items = dataArray.map((item) => ({
|
|
title: item.title,
|
|
description: item.summary,
|
|
pubDate: parseDate(item.original_timestamp, 'X'),
|
|
link: `${host}${item.url}`,
|
|
category: item.tag,
|
|
}));
|
|
|
|
ctx.state.data = {
|
|
title: `安全内参-${author}`,
|
|
link: 'https://www.secrss.com',
|
|
item: items,
|
|
};
|
|
};
|