UNPKG

rsshub

Version:
43 lines (39 loc) 1.24 kB
import { i as types, n as apiRootUrl, r as rootUrl, t as ProcessThreads } from "./utils-D9Uy9L3J.mjs"; //#region lib/routes/1point3acres/thread.ts const route = { path: "/thread/:type?/:order?", example: "/1point3acres/thread/hot", parameters: { type: "帖子分类, 见下表,默认为 hot,即热门帖子", order: "排序方式,见下表,默认为空,即最新回复" }, name: "帖子", categories: ["bbs"], maintainers: [ "IvanWng97", "DIYgod", "nczitzk" ], handler, url: "instant.1point3acres.com/", description: `分类 | 热门帖子 | 最新帖子 | | -------- | -------- | | hot | new | 排序方式 | 最新回复 | 最新发布 | | -------- | -------- | | | post |` }; async function handler(ctx) { const type = ctx.req.param("type") ?? "hot"; const order = ctx.req.param("order") ?? ""; const apiUrl = `${apiRootUrl}/api/threads?type=${type}&includes=tags,forum_name,summary&ps=${ctx.req.query("limit") ? Number.parseInt(ctx.req.query("limit")) : 10}&pg=1&order=${order === "" ? "" : "time_desc"}&is_groupid=1`; return { title: `一亩三分地 - ${types[type]}`, link: rootUrl, item: await ProcessThreads(apiUrl, order) }; } //#endregion export { route };