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, + }; +};