parent
020cef5e5b
commit
8d933537c8
|
|
@ -887,6 +887,12 @@ rule
|
|||
免费版账户抖音每天查询次数 20 次,如需增加次数可购买新榜会员或等待未来多账户支持
|
||||
:::
|
||||
|
||||
## 悟空问答
|
||||
|
||||
### 用户动态
|
||||
|
||||
<Route author="nczitzk" example="/wukong/user/5826687196" path="/wukong/user/:id" :paramsDesc="['用户ID,可在用户页 URL 中找到']"/>
|
||||
|
||||
## 知乎
|
||||
|
||||
### 收藏夹
|
||||
|
|
|
|||
|
|
@ -3061,6 +3061,9 @@ router.get('/telecompaper/news/:caty/:year?/:country?/:type?/:keyword?', require
|
|||
// 水木社区
|
||||
router.get('/newsmth/account/:id', require('./routes/newsmth/account'));
|
||||
|
||||
// 悟空问答
|
||||
router.get('/wukong/user/:id', require('./routes/wukong/user'));
|
||||
|
||||
// 腾讯大数据
|
||||
router.get('/tencent/bigdata', require('./routes/tencent/bigdata/index'));
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const userUrl = `https://www.wukong.com/wenda/web/my/brow/?count=20&other_uid=${ctx.params.id}`;
|
||||
const dongtaiUrl = `https://www.wukong.com/wenda/web/dongtai/list/brow/?other_uid=${ctx.params.id}&count=15&max_time=&style=1`;
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: dongtaiUrl,
|
||||
});
|
||||
const userResponse = await got({
|
||||
method: 'get',
|
||||
url: userUrl,
|
||||
});
|
||||
|
||||
const list = response.data.data.dongtai_list.map((item) => {
|
||||
if (item.cell_id === 0) {
|
||||
return Promise.resolve('');
|
||||
}
|
||||
const isQuestion = item.dongtai_cell.dongtai.OriginIdType === 1;
|
||||
return {
|
||||
title: `${item.dongtai_cell.dongtai.content.text}:${item.dongtai_cell.dongtai.base.question.title}`,
|
||||
link: isQuestion ? `https://www.wukong.com/question/${item.dongtai_cell.dongtai.base.question.qid}` : `https://www.wukong.com/answer/${item.dongtai_cell.dongtai.base.answer.ansid}`,
|
||||
description: isQuestion ? item.dongtai_cell.dongtai.base.question.content.text : item.dongtai_cell.dongtai.base.answer.content,
|
||||
pubDate: new Date((isQuestion ? item.dongtai_cell.dongtai.base.question.create_time : item.dongtai_cell.dongtai.base.answer.create_time) * 1000).toUTCString(),
|
||||
};
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: `悟空问答 - ${userResponse.data.other_user_info.uname}`,
|
||||
link: `https://www.wukong.com/user/?uid=${ctx.params.id}`,
|
||||
item: list,
|
||||
description: `${userResponse.data.other_user_info.description}`,
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue