Files
RSSHub/lib/v2/1point3acres/user/thread.js
T
2024-02-29 00:55:47 +08:00

22 lines
788 B
JavaScript

import got from '@/utils/got';
module.exports = async (ctx) => {
const id = ctx.req.param('id');
const { threads } = (await got.get(`https://instant.1point3acres.com/v2/api/user/thread?pg=1&ps=10&user_id=${id}`)).data;
const [{ author_name: author }] = threads;
ctx.set('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}`,
})),
});
};