mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-07 21:47:57 +08:00
Add 1point3acres 一亩三分地 (#1954)
This commit is contained in:
@@ -485,3 +485,9 @@
|
|||||||
## 方格子
|
## 方格子
|
||||||
|
|
||||||
<Route name="出版專題" author="Maecenas" example="/vocus/publication/bass" path="/vocus/publication/:id" :paramsDesc="['出版專題 id,可在出版專題主页的 URL 找到']"/>
|
<Route name="出版專題" author="Maecenas" example="/vocus/publication/bass" path="/vocus/publication/:id" :paramsDesc="['出版專題 id,可在出版專題主页的 URL 找到']"/>
|
||||||
|
|
||||||
|
## 一亩三分地
|
||||||
|
|
||||||
|
<Route name="主题帖" author="Maecenas" example="/1point3acres/user/1/threads" path="/1point3acres/user/:id/threads" :paramsDesc="['用户 id,可在 Instant 版网站的个人主页 URL 找到']"/>
|
||||||
|
|
||||||
|
<Route name="回帖" author="Maecenas" example="/1point3acres/user/1/posts" path="/1point3acres/user/:id/posts" :paramsDesc="['用户 id,可在 Instant 版网站的个人主页 URL 找到']"/>
|
||||||
|
|||||||
@@ -1263,4 +1263,8 @@ router.get('/bupt/yz/:type', require('./routes/universities/bupt/yz'));
|
|||||||
// VOCUS 方格子
|
// VOCUS 方格子
|
||||||
router.get('/vocus/publication/:id', require('./routes/vocus/publication'));
|
router.get('/vocus/publication/:id', require('./routes/vocus/publication'));
|
||||||
|
|
||||||
|
// 一亩三分地 1point3acres
|
||||||
|
router.get('/1point3acres/user/:id/threads', require('./routes/1point3acres/threads'));
|
||||||
|
router.get('/1point3acres/user/:id/posts', require('./routes/1point3acres/posts'));
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
|||||||
21
lib/routes/1point3acres/posts.js
Normal file
21
lib/routes/1point3acres/posts.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
const axios = require('../../utils/axios');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const { id } = ctx.params;
|
||||||
|
|
||||||
|
const { posts } = (await axios.get(`https://instant.1point3acres.com/v2/api/user/post?pg=1&ps=10&user_id=${id}`)).data;
|
||||||
|
const [{ author_name: author }] = posts;
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: `${author}的回复 - 一亩三分地`,
|
||||||
|
link: `https://instant.1point3acres.com/profile/${id}`,
|
||||||
|
description: `${author}的回复 - 一亩三分地`,
|
||||||
|
item: posts.map((item) => ({
|
||||||
|
title: item.message,
|
||||||
|
author,
|
||||||
|
description: item.message,
|
||||||
|
pubDate: new Date(item.create_time + ' GMT+8').toUTCString(),
|
||||||
|
link: `https://instant.1point3acres.com/thread/${item.thread_id}/post/${item.id}`,
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
};
|
||||||
21
lib/routes/1point3acres/threads.js
Normal file
21
lib/routes/1point3acres/threads.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
const axios = require('../../utils/axios');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const { id } = ctx.params;
|
||||||
|
|
||||||
|
const { threads } = (await axios.get(`https://instant.1point3acres.com/v2/api/user/thread?pg=1&ps=10&user_id=${id}`)).data;
|
||||||
|
const [{ author_name: author }] = threads;
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: `${author}的主题帖 - 一亩三分地`,
|
||||||
|
link: `https://instant.1point3acres.com/profile/${id}`,
|
||||||
|
description: `${author}的主题帖 - 一亩三分地`,
|
||||||
|
item: threads.map((item) => ({
|
||||||
|
title: item.title,
|
||||||
|
author,
|
||||||
|
description: item.description,
|
||||||
|
pubDate: new Date(item.update_time + ' GMT+8').toUTCString(),
|
||||||
|
link: `https://instant.1point3acres.com/thread/${item.id}`,
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user