UNPKG

rsshub

Version:
50 lines (49 loc) 1.38 kB
import "./types-DNj6Etbg.mjs"; import { t as utils_default } from "./utils-JKAGWZqQ.mjs"; //#region lib/routes/mi/crowdfunding.ts const route = { path: "/crowdfunding", categories: ["shopping"], example: "/mi/crowdfunding", name: "小米众筹", maintainers: ["DIYgod", "nuomi1"], handler, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportRadar: true, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["m.mi.com/crowdfunding/home"], target: "/crowdfunding" }], view: 5 }; const getDetails = async (list) => { const result = list.flatMap((section) => section.items.map((item) => utils_default.getCrowdfundingItem(item))); return await Promise.all(result); }; const getDataItem = (item) => ({ title: item.project_name, description: utils_default.renderCrowdfunding(item), link: `https://m.mi.com/crowdfunding/proddetail/${item.project_id}`, image: item.big_image, language: "zh-CN" }); async function handler() { const list = await utils_default.getCrowdfundingList(); return { title: "小米众筹", link: "https://m.mi.com/crowdfunding/home", item: (await getDetails(list)).map((item) => getDataItem(item)), allowEmpty: true, image: "https://m.mi.com/static/img/icons/apple-touch-icon-152x152.png", language: "zh-CN" }; } //#endregion export { route };