feat: add 金色财经头条 (#5487)

Co-authored-by: Henry Wang <hi@henry.wang>
This commit is contained in:
Ethan Shen
2020-08-24 12:54:37 +01:00
committed by GitHub
co-authored by Henry Wang
parent 90e1f80e78
commit 1f06af9fd0
3 changed files with 26 additions and 0 deletions
+4
View File
@@ -718,6 +718,10 @@ area 分区选项
<Route author="nczitzk" example="/jinse/lives" path="/jinse/lives"/>
### 头条
<Route author="nczitzk" example="/jinse/timeline" path="/jinse/timeline"/>
### 分类
<Route author="nczitzk" example="/jinse/catalogue/zhengce" path="/jinse/catalogue/:caty" :paramsDesc="['分类名,参见下表']">
+1
View File
@@ -2767,6 +2767,7 @@ router.get('/qingting/channel/:id', require('./routes/qingting/channel'));
// 金色财经
router.get('/jinse/lives', require('./routes/jinse/lives'));
router.get('/jinse/timeline', require('./routes/jinse/timeline'));
router.get('/jinse/catalogue/:caty', require('./routes/jinse/catalogue'));
// deeplearning.ai
+21
View File
@@ -0,0 +1,21 @@
const got = require('@/utils/got');
module.exports = async (ctx) => {
const liveUrl = `https://api.jinse.com/noah/v1/www/timelines?&limit=23&flag=down`;
const response = await got({
method: 'get',
url: liveUrl,
});
ctx.state.data = {
title: '金色财经 - 头条',
link: liveUrl,
item: response.data.data.list.map((item) => ({
title: item.title,
link: item.extra.topic_url,
author: item.extra.author,
description: item.extra.summary,
pubDate: new Date(item.extra.published_at * 1000).toUTCString(),
})),
};
};