mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 23:00:48 +08:00
feat: 增加二柄APP新闻 (#5081)
This commit is contained in:
@@ -461,3 +461,9 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的
|
||||
### 游戏横幅
|
||||
|
||||
<Route author="y2361547758" example="/magireco/event_banner" path="/magireco/event_banner"/>
|
||||
|
||||
## 二柄APP
|
||||
|
||||
### 新闻
|
||||
|
||||
<Route author="wushijishan" example="/erbingapp/news" path="/erbingapp/news"/>
|
||||
|
||||
@@ -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'));
|
||||
|
||||
|
||||
33
lib/routes/erbingapp/news.js
Normal file
33
lib/routes/erbingapp/news.js
Normal file
@@ -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 += `<br><img src="${item.video_img}">`;
|
||||
} else {
|
||||
const imgs = item.acontent.split(',');
|
||||
for (let i = 0; i < imgs.length; i++) {
|
||||
description += `<br><img src="${imgs[i]}">`;
|
||||
}
|
||||
}
|
||||
return {
|
||||
description,
|
||||
link: item.share.url,
|
||||
title: item.title,
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user