Files
RSSHub/lib/routes/geekpark/breakingnews.js
2019-08-25 11:03:25 +08:00

26 lines
1010 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const got = require('@/utils/got');
module.exports = async (ctx) => {
const url = 'https://mainssl.geekpark.net/api/v1/posts';
const link = 'https://www.geekpark.net';
const response = await got({
method: 'get',
url,
});
const data = response.data.posts;
ctx.state.data = {
title: '极客公园 - 资讯',
description:
'极客公园聚焦互联网领域跟踪最新的科技新闻动态关注极具创新精神的科技产品。目前涵盖前沿科技、游戏、手机评测、硬件测评、出行方式、共享经济、人工智能等全方位的科技生活内容。现有前沿社、挖App、深度报道、极客养成指南等多个内容栏目。',
link,
item: data.map(({ title, content, published_at, id }) => ({
title,
link: `https://www.geekpark.net/news/${id}`,
description: content,
pubDate: new Date(published_at).toUTCString(),
})),
};
};