Files
RSSHub/lib/v2/zooTeam/blog.js
Humble c91a4cdd1d feat(route):add 政采云前端小报和博客 (#9379)
* feat(route):add 政采云前端小报和博客

* fix:因为使用了空值合并操作符??,所有node的版本必须大于等于14

* feat(route):add 政采云前端小报和博客

* fix:因为使用了空值合并操作符??,所有node的版本必须大于等于14

* docs:新增英文说明

* docs:调整位置

* feat: Modify Backquotes

* fix:remove duplicate rssbud and add zooTeam

* fix: add a close tag

* docs: fix docs tags and attrs

* fix:add timezone
2022-03-25 20:47:06 +08:00

33 lines
1.0 KiB
JavaScript

const got = require('@/utils/got');
const timezone = require('@/utils/timezone');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://www.zoo.team/api/articles',
});
const data = response.data.data.articles;
ctx.state.data = {
// 源标题
title: '政采云前端博客',
// 源链接
link: 'https://www.zoo.team',
// 源说明
description: '政采云前端博客',
// 遍历此前获取的数据
item: data.map((item) => ({
// 文章标题
title: item.title,
// 文章正文
description: `${item.desc}<br><img src="${item.cover}">`,
// 文章发布时间
pubDate: timezone(parseDate(item.created_at), +8),
// 文章链接
link: `https://zoo.team/article/${item.path}`,
// 分类
category: item.category,
})),
};
};