rsshub
Version:
Make RSS Great Again!
60 lines (57 loc) • 1.7 kB
JavaScript
import { n as init_esm_shims, t as __dirname } from "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as art } from "./render-BQo6B4tL.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import path from "node:path";
//#region lib/routes/xiaomiyoupin/utils.ts
init_esm_shims();
const parseModule = (floors, module_key) => floors.find((floor) => floor.module_key === module_key);
const parseFloorItem = (floor) => floor.data.items.map((item) => {
const i = item.item;
return {
title: i.name,
link: i.jump_url,
guid: `xiaomiyoupin:${i.gid}`,
description: art(path.join(__dirname, "templates/goods-53c6f4ec.art"), i),
pubDate: (i.start || i.start_time) * 1e3
};
});
//#endregion
//#region lib/routes/xiaomiyoupin/latest.ts
const route = {
path: "/latest",
categories: ["shopping"],
example: "/xiaomiyoupin/latest",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["xiaomiyoupin.com/"] }],
name: "小米有品每日上新",
maintainers: [
"xyqfer",
"DIYgod",
"bigfei"
],
handler,
url: "xiaomiyoupin.com/"
};
async function handler() {
return {
title: "小米有品每日上新",
link: "https://m.xiaomiyoupin.com/w/newproduct?pageid=1605",
description: "小米有品每日上新",
item: parseFloorItem(parseModule((await got_default("https://m.xiaomiyoupin.com/homepage/main/v1005")).data.data.homepage.floors, "product_hot"))
};
}
//#endregion
export { route };