mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-06 05:03:44 +08:00
feat: add kaggle user discussion (#5192)
This commit is contained in:
19
lib/routes/kaggle/user.js
Normal file
19
lib/routes/kaggle/user.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: `https://www.kaggle.com/${ctx.params.user}/discussion_messages.json?sortBy=latestPost&group=commentsAndTopics&page=1&pageSize=20&sortby=latestPost&pagesize=20`,
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${ctx.params.user}'s discussion - Kaggle`,
|
||||
link: `https://www.kaggle.com/${ctx.params.user}/discussion?sortBy=mostVotes&group=commentsAndTopics&page=1&pageSize=20`,
|
||||
item: response.data.discussions.map((item) => ({
|
||||
title: item.forum.name,
|
||||
link: `https://www.kaggle.com${item.forum.url}`,
|
||||
description: item.message,
|
||||
pubDate: new Date(item.postDate).toUTCString(),
|
||||
})),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user