From 06ff1446b94bb7779070ae6d518e7bd5ffe70b04 Mon Sep 17 00:00:00 2001 From: MyFaith Date: Tue, 12 Mar 2019 22:35:19 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E5=B0=8F=E9=BB=91=E7=9B=92?= =?UTF-8?q?=E6=96=B0=E9=97=BB=E3=80=81=E6=89=93=E6=8A=98=E6=83=85=E5=86=B5?= =?UTF-8?q?=EF=BC=8C=E6=B8=B8=E6=88=8F=E6=97=B6=E5=85=89=E6=96=B0=E9=97=BB?= =?UTF-8?q?=E3=80=81=E5=8F=91=E5=94=AE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 10 ++++++++++ lib/router.js | 6 ++++++ lib/routes/vgtime/news.js | 20 ++++++++++++++++++++ lib/routes/vgtime/release.js | 20 ++++++++++++++++++++ lib/routes/xiaoheihe/discount.js | 20 ++++++++++++++++++++ lib/routes/xiaoheihe/news.js | 20 ++++++++++++++++++++ 6 files changed, 96 insertions(+) create mode 100644 lib/routes/vgtime/news.js create mode 100644 lib/routes/vgtime/release.js create mode 100644 lib/routes/xiaoheihe/discount.js create mode 100644 lib/routes/xiaoheihe/news.js diff --git a/docs/README.md b/docs/README.md index c376315d691101..02d6d7552be4ca 100755 --- a/docs/README.md +++ b/docs/README.md @@ -2507,10 +2507,20 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的 + + + + ### Indienova +### 游戏时光 + + + + + ## 小说·文学·阅读 ### 观止(每日一文) diff --git a/lib/router.js b/lib/router.js index 839b9be3d53931..89cdffa8991160 100755 --- a/lib/router.js +++ b/lib/router.js @@ -1025,6 +1025,8 @@ router.get('/gov/mee/gs', require('./routes/gov/mee/gs')); // 小黑盒 router.get('/xiaoheihe/user/:id', require('./routes/xiaoheihe/user')); +router.get('/xiaoheihe/news', require('./routes/xiaoheihe/news')); +router.get('/xiaoheihe/discount', require('./routes/xiaoheihe/discount')); // 惠誉评级 router.get('/fitchratings/site/:type', require('./routes/fitchratings/site')); @@ -1133,4 +1135,8 @@ router.get('/blogs/jingwei.link', require('./routes/blogs/jingwei_link')); router.get('/uraaka-joshi', require('./routes/uraaka-joshi/uraaka-joshi')); router.get('/uraaka-joshi/:id', require('./routes/uraaka-joshi/uraaka-joshi-user')); +// 游戏时光 +router.get('/vgtime/news', require('./routes/vgtime/news.js')); +router.get('/vgtime/release', require('./routes/vgtime/release')); + module.exports = router; diff --git a/lib/routes/vgtime/news.js b/lib/routes/vgtime/news.js new file mode 100644 index 00000000000000..a57b1eac7edede --- /dev/null +++ b/lib/routes/vgtime/news.js @@ -0,0 +1,20 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: `http://www.vgtime.com/vgtime-app/api/v2/homepage/listByTag.json?page=1&pageSize=20&tags=1`, + }); + const data = response.data.data.topicList; + + ctx.state.data = { + title: `游戏时光新闻列表`, + link: `http://www.vgtime.com/topic/index.jhtml`, + item: data.map((item) => ({ + title: item.title, + description: `作者:${item.user.name}`, + pubDate: new Date(item.publishDate * 1000).toUTCString(), + link: item.shareUrl, + })), + }; +}; diff --git a/lib/routes/vgtime/release.js b/lib/routes/vgtime/release.js new file mode 100644 index 00000000000000..7deda246d030a6 --- /dev/null +++ b/lib/routes/vgtime/release.js @@ -0,0 +1,20 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: `http://app02.vgtime.com:8080/vgtime-app/api/v2/game/last/sales`, + }); + const data = response.data.data.gameList; + + ctx.state.data = { + title: `游戏时光游戏发售表`, + link: `https://www.vgtime.com/game/release.jhtml`, + item: data.map((item) => ({ + title: item.title, + description: `平台:${item.platformsText};${item.introduction}`, + pubDate: item.publishDate, + link: item.shareUrl, + })), + }; +}; diff --git a/lib/routes/xiaoheihe/discount.js b/lib/routes/xiaoheihe/discount.js new file mode 100644 index 00000000000000..39044043d35483 --- /dev/null +++ b/lib/routes/xiaoheihe/discount.js @@ -0,0 +1,20 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: `https://api.xiaoheihe.cn/game/all_recommend/games/?show_type=discount&offset=0&limit=30&heybox_id=12777814&imei=867252032615972&os_type=Android&os_version=9&version=1.1.55&_time=1551803757&hkey=6977cde54ab859fbb98757d3e6b953d9`, + }); + const data = response.data.result.list; + + ctx.state.data = { + title: `小黑盒游戏打折情况`, + link: `https://xiaoheihe.cn/games/index`, + item: data.map((item) => ({ + title: item.game_name, + description: `原价¥${item.heybox_price.original_coin / 1000}元,现价¥${item.heybox_price.cost_coin / 1000}元,折扣力度${item.heybox_price.discount}%OFF`, + pubDate: ('' + item.price.deadline_date).replace(' 截止', ''), + link: item.game_img, + })), + }; +}; diff --git a/lib/routes/xiaoheihe/news.js b/lib/routes/xiaoheihe/news.js new file mode 100644 index 00000000000000..a63033b33d2587 --- /dev/null +++ b/lib/routes/xiaoheihe/news.js @@ -0,0 +1,20 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: `https://api.xiaoheihe.cn/maxnews/app/list?tag=-1&offset=0&limit=30&rec_mark=timeline&heybox_id=12777814&imei=867252032615972&os_type=Android&os_version=9&version=1.1.55&_time=1551801017&hkey=b28cd7a1cba463b4d9176ba2f8f42d35`, + }); + const data = response.data.result; + + ctx.state.data = { + title: `小黑盒游戏新闻`, + link: `https://xiaoheihe.cn/community/index`, + item: data.map((item) => ({ + title: item.title, + description: item.description, + pubDate: item.date, + link: item.newUrl, + })), + }; +};