From ab2a46a8cc5ec2f866a3ec168a6ef27da5891b21 Mon Sep 17 00:00:00 2001 From: Ethan Shen Date: Thu, 8 Oct 2020 22:05:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20add=20=E5=AE=88=E6=9C=9B=E5=85=88?= =?UTF-8?q?=E9=94=8B=E8=A1=A5=E4=B8=81=E8=AF=B4=E6=98=8E=20(#5769)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Henry Wang --- docs/other.md | 6 ++++++ lib/router.js | 3 +++ lib/routes/ow/patch.js | 23 +++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 lib/routes/ow/patch.js diff --git a/docs/other.md b/docs/other.md index 2f1de25e7..59c373ec6 100644 --- a/docs/other.md +++ b/docs/other.md @@ -848,3 +848,9 @@ type 为 all 时,category 参数不支持 cost 和 free ### はてな匿名ダイアリー - 人気記事アーカイブ + +## 守望先锋 + +### 补丁说明 + + diff --git a/lib/router.js b/lib/router.js index 7a6ffc2f8..c7304a9ec 100644 --- a/lib/router.js +++ b/lib/router.js @@ -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')); diff --git a/lib/routes/ow/patch.js b/lib/routes/ow/patch.js new file mode 100644 index 000000000..3e5f027ae --- /dev/null +++ b/lib/routes/ow/patch.js @@ -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, + }; +};