mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-10 23:34:38 +08:00
feat: Tapechat 小纸条提问箱 (#6217)
This commit is contained in:
@@ -465,6 +465,12 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
|
||||
|
||||
<Route author="BugWriter2" example="/soul/posts/hot" path="/soul/posts/hot" radar="1" rssbud="1"></Route>
|
||||
|
||||
## Tape 小纸条
|
||||
|
||||
### 提问箱新回答
|
||||
|
||||
<Route author="AgFlore" example="/tapechat/questionbox/TOAH7BBH" path="/tapechat/questionbox/:sharecode/:pagesize?" :paramsDesc="['提问箱 ID', '查看条数(默认为 20)']" />
|
||||
|
||||
## Telegram
|
||||
|
||||
### 频道
|
||||
|
||||
@@ -3077,6 +3077,9 @@ router.get('/go-weekly', require('./routes/go-weekly'));
|
||||
// popiask提问箱
|
||||
router.get('/popiask/:sharecode/:pagesize?', require('./routes/popiask/questions'));
|
||||
|
||||
// Tapechat提问箱
|
||||
router.get('/tapechat/questionbox/:sharecode/:pagesize?', require('./routes/popiask/tapechat_questions'));
|
||||
|
||||
// AMD
|
||||
router.get('/amd/graphicsdrivers/:id/:rid?', require('./routes/amd/graphicsdrivers'));
|
||||
|
||||
|
||||
43
lib/routes/popiask/tapechat_questions.js
Normal file
43
lib/routes/popiask/tapechat_questions.js
Normal file
@@ -0,0 +1,43 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const sharecode = ctx.params.sharecode;
|
||||
const pagesize = ctx.params.pagesize || 20;
|
||||
|
||||
const getUserInfo = await got({
|
||||
method: 'get',
|
||||
url: `https://apiv4.tapechat.net/unuser/userBox/${sharecode}`,
|
||||
headers: {
|
||||
Referer: `https://www.tapechat.net/${sharecode}`,
|
||||
},
|
||||
});
|
||||
|
||||
const nickname = getUserInfo.data.content.nickName;
|
||||
const production = getUserInfo.data.content.production;
|
||||
const avatar = getUserInfo.data.content.customPic;
|
||||
// const description = getUserInfo.data.content.selfDescription;
|
||||
|
||||
const getQuestionFromUser = await got({
|
||||
method: 'get',
|
||||
url: `https://apiv4.tapechat.net/unuser/getQuestionFromUser/${sharecode}?pageSize=${pagesize}`,
|
||||
headers: {
|
||||
Referer: `https://www.tapeask.net/${sharecode}`,
|
||||
},
|
||||
});
|
||||
|
||||
const data = getQuestionFromUser.data.content.data;
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${nickname} 的 Tape 提问箱`,
|
||||
link: `https://www.tapechat.net/${sharecode}`,
|
||||
image: `${avatar}`,
|
||||
description: `${production}`,
|
||||
item: data.map((item) => ({
|
||||
title: item.title,
|
||||
description: `${item.title}<br>(${item.createdAt})<br><br><b>答:</b><br>${item.answer.txtContent}<br>(${new Date(item.answerAt * 1000).toLocaleString()})`,
|
||||
guid: item.visitCode,
|
||||
pubDate: new Date(item.answerAt * 1000).toUTCString(),
|
||||
link: `https://www.tapechat.net/answeredDetail.html?sharecode=${sharecode}&dynamicId=${item.visitCode}`,
|
||||
})),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user