增加:laosiji hotshow (#1223)

Closes #1222
This commit is contained in:
凉凉 2018-12-04 14:23:43 +08:00 committed by DIYgod
parent 8b302a4d6c
commit feed8c8f95
3 changed files with 34 additions and 0 deletions

View File

@ -2368,6 +2368,7 @@ IATA 国际航空运输协会机场代码, 参见[维基百科 国际航空运
<route name="首页" author="xyqfer" example="/laosiji/feed" path="/laosiji/feed"/>
<route name="24小时热门" author="xyqfer" example="/laosiji/hot" path="/laosiji/hot"/>
<route name="节目" author="xyqfer" example="/laosiji/hotshow/128" path="/laosiji/hotshow/:id" :paramsDesc="['节目 id']"/>
### 99% Invisible

View File

@ -724,6 +724,7 @@ router.get('/houxu/:type/:id', require('./routes/houxu/houxu'));
// 老司机
router.get('/laosiji/hot', require('./routes/laosiji/hot'));
router.get('/laosiji/feed', require('./routes/laosiji/feed'));
router.get('/laosiji/hotshow/:id', require('./routes/laosiji/hotshow'));
// 99% Invisible
router.get('/99percentinvisible/transcript', require('./routes/99percentinvisible/transcript'));

32
routes/laosiji/hotshow.js Normal file
View File

@ -0,0 +1,32 @@
const axios = require('../../utils/axios');
const qs = require('querystring');
module.exports = async (ctx) => {
const { id } = ctx.params;
const link = `http://www.laosiji.com/hotshow/detail/${id}`;
const response = await axios({
method: 'post',
url: 'http://www.laosiji.com/api/hotShow/program',
headers: {
Referer: link,
'Content-Type': 'application/x-www-form-urlencoded',
},
data: qs.stringify({
hotShowId: id,
sort: 1,
pageNo: 1,
}),
});
const data = response.data.body.hotshow;
ctx.state.data = {
title: `老司机-${data.name}`,
link,
item: data.sns.list.map(({ title, resourceid, image }) => ({
title,
link: `http://www.laosiji.com/thread/${resourceid}.html`,
description: `<img referrerpolicy="no-referrer" src="${image.url}">`,
})),
};
};