feat: add 守望先锋补丁说明 (#5769)

Co-authored-by: Henry Wang <hi@henry.wang>
This commit is contained in:
Ethan Shen 2020-10-08 22:05:09 +08:00 committed by GitHub
parent e6811360b2
commit ab2a46a8cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 0 deletions

View File

@ -848,3 +848,9 @@ type 为 all 时category 参数不支持 cost 和 free
### はてな匿名ダイアリー - 人気記事アーカイブ
<Route author="masakichi" example="/hatena/anonymous_diary/archive" path="/hatena/anonymous_diary/archive"/>
## 守望先锋
### 补丁说明
<Route author="nczitzk" example="/ow/patch" path="/ow/patch"/>

View File

@ -3257,6 +3257,9 @@ router.get('/appsales/:caty?/:time?', require('./routes/appsales/index'));
// CGTN
router.get('/cgtn/top', require('./routes/cgtn/top'));
// 守望先锋
router.get('/ow/patch', require('./routes/ow/patch'));
// MM范
router.get('/95mm/tab/:tab?', require('./routes/95mm/tab'));
router.get('/95mm/tag/:tag', require('./routes/95mm/tag'));

23
lib/routes/ow/patch.js Normal file
View File

@ -0,0 +1,23 @@
const got = require('@/utils/got');
module.exports = async (ctx) => {
const rootUrl = 'https://ow.blizzard.cn';
const currentUrl = `${rootUrl}/action/article/patch?p=1&pageSize=10`;
const response = await got({
method: 'get',
url: currentUrl,
});
const items = response.data.data.list.map((item) => ({
title: item.description,
link: `${rootUrl}/article/news/${item.articleId}`,
description: item.content,
pubDate: new Date(item.publishTime).toUTCString(),
}));
ctx.state.data = {
title: '《守望先锋》补丁说明',
link: `${rootUrl}/game/patch-notes`,
item: items,
};
};