✨ 小黑盒新闻、打折情况,游戏时光新闻、发售表 (#1736)

This commit is contained in:
Yorkin Yuan
2019-03-13 11:56:55 +08:00
committed by DIYgod
parent 1a8b5b3614
commit e505e463e0
6 changed files with 96 additions and 0 deletions
+10
View File
@@ -2534,10 +2534,20 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的
<route name="用户动态" author="LogicJake" example="/xiaoheihe/user/7775687" path="xiaoheihe/user/:id" :paramsDesc="['用户 id']"/>
<route name="游戏新闻" author="MyFaith" example="/xiaoheihe/news" path="xiaoheihe/news"/>
<route name="游戏打折情况" author="MyFaith" example="/xiaoheihe/discount" path="xiaoheihe/discount"/>
### Indienova
<route name="indienova 文章" author="GensouSakuya" example="/indienova/article" path="indienova/article"/>
### 游戏时光
<route name="游戏时光新闻" author="MyFaith" example="/vgtime/news" path="vgtime/news"/>
<route name="游戏时光游戏发售表" author="MyFaith" example="/vgtime/release" path="vgtime/release"/>
## 小说·文学·阅读
### 观止(每日一文)
+6
View File
@@ -1032,6 +1032,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'));
@@ -1143,6 +1145,10 @@ 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'));
// MP4吧
router.get('/mp4ba/:param', require('./routes/mp4ba'));
+20
View File
@@ -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,
})),
};
};
+20
View File
@@ -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,
})),
};
};
+20
View File
@@ -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,
})),
};
};
+20
View File
@@ -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,
})),
};
};