UNPKG

rsshub

Version:
35 lines (34 loc) 1.14 kB
import { t as parseDate } from "./parse-date-Cr0wQjV_.mjs"; import { n as fetchJson, r as getNextBuildId, t as baseUrl } from "./utils-B5WzD6Oc.mjs"; //#region lib/routes/makerworld/contest.ts const route = { path: "/contests", categories: ["design"], example: "/makerworld/contests", name: "Contests", maintainers: ["TonyRL"], handler, radar: [{ source: ["makerworld.com/:lang/contests"] }] }; async function handler() { const { listConst, previewList } = (await fetchJson(`${baseUrl}/_next/data/${await getNextBuildId()}/en/contests.json`)).pageProps; const items = [...listConst.map((c) => ({ title: c.contestName, link: `${baseUrl}/en/contests/${c.id}?name=${c.contestName}`, description: c.themeDesc, pubDate: parseDate(c.startTime) })), ...previewList.map((p) => ({ title: p.contestTheme, description: p.themeDesc, pubDate: parseDate(p.contestTime) }))]; return { title: "Contest - MakerWorld", description: "Join the contest to showcase your creativity and win substantial rewards", link: `${baseUrl}/en/contests`, image: `${baseUrl}/favicon_new.png`, item: items }; } //#endregion export { route };