feat: add 白鲸出海 (#3743)

This commit is contained in:
jeffcott
2020-01-14 15:51:01 +08:00
committed by DIYgod
parent 1da57d937b
commit 46a403f28d
4 changed files with 64 additions and 0 deletions

View File

@@ -956,4 +956,15 @@
},
],
},
'baijingapp.com': {
_name: '白鲸出海',
www: [
{
title: '文章',
docs: 'https://docs.rsshub.app/new-media.html#bai-jing-chu-hai',
source: '',
target: '/baijing',
},
],
},
});

View File

@@ -255,6 +255,12 @@ Supported sub-sites
<Route author="hillerliao" example="/8btc/news/flash" path="/8btc/news/flash"/>
## 白鲸出海
### 首页最新帖子
<Route author="jeffcottLu" example="/baijing" path="/baijing"></Route>
## 坂道系列官网新闻
### 乃木坂 46

View File

@@ -2098,6 +2098,9 @@ router.get('/mlog-club/projects', require('./routes/mlog-club/projects'));
// Chrome 网上应用店
router.get('/chrome/webstore/extensions/:id', require('./routes/chrome/extensions'));
// 白鲸出海
router.get('/baijing', require('./routes/baijing'));
// 低端影视
router.get('/ddrk/:name/:season?', require('./routes/ddrk/index'));

View File

@@ -0,0 +1,44 @@
const got = require('@/utils/got');
module.exports = async (ctx) => {
const response = await got({
method: 'post',
url: 'http://www.baijingapp.com/api/get_more_articles/',
form: true,
responseType: 'json',
body: {
deviceid: 'ios',
page: 1,
},
});
const resList = response.data;
// json字符串转json对象
const resListObj = new Function('return ' + resList)();
if (resListObj.state === 1) {
const output = resListObj.data.list.map((item) => {
const title = item.title;
const link = 'https://www.baijingapp.com/article/' + item.id;
const time = item.time;
const author = item.user_name;
const image = item.image;
const single = {
title,
link,
time,
author,
image,
};
return single;
});
ctx.state.data = {
title: `白鲸出海`,
desription: '白鲸出海 - 泛互联网出海服务平台',
item: output,
};
}
};