diff --git a/docs/game.md b/docs/game.md index 70a84c48d0..70d901fc4a 100755 --- a/docs/game.md +++ b/docs/game.md @@ -461,3 +461,9 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的 ### 游戏横幅 + +## 二柄APP + +### 新闻 + + diff --git a/lib/router.js b/lib/router.js index c7c392a81d..10b56d90c9 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2896,6 +2896,9 @@ router.get('/go-weekly', require('./routes/go-weekly')); // AMD router.get('/amd/graphicsdrivers/:id/:rid?', require('./routes/amd/graphicsdrivers')); +// 二柄APP +router.get('/erbingapp/news', require('./routes/erbingapp/news')); + // 电商报 router.get('/dsb/area/:area', require('./routes/dsb/area')); diff --git a/lib/routes/erbingapp/news.js b/lib/routes/erbingapp/news.js new file mode 100644 index 0000000000..9bfea1af82 --- /dev/null +++ b/lib/routes/erbingapp/news.js @@ -0,0 +1,33 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const response = await got({ + method: 'get', + url: `https://api.diershoubing.com:5001/feed/tag/?pn=0&rn=20&tag_type=0&src=ios`, + resolveBodyOnly: true, + responseType: 'json', + }); + const data = response.feeds; + + ctx.state.data = { + title: `二柄APP`, + link: `https://www.diershoubing.com/`, + description: `二柄APP新闻`, + item: data.map((item) => { + let description = item.content; + if (item.video_img !== null) { + description += `
`; + } else { + const imgs = item.acontent.split(','); + for (let i = 0; i < imgs.length; i++) { + description += `
`; + } + } + return { + description, + link: item.share.url, + title: item.title, + }; + }), + }; +};