UNPKG

rsshub

Version:
47 lines (46 loc) 1.38 kB
import { t as config } from "./config-Bpyy15zS.mjs"; import { t as ConfigNotFoundError } from "./config-not-found-fQ5mxvDU.mjs"; import { t as getFanfou } from "./utils-C4xS73WE.mjs"; //#region lib/routes/fanfou/trends.ts const route = { path: "/trends", categories: ["social-media"], example: "/fanfou/trends", name: "热门话题", maintainers: ["junbaor"], features: { requireConfig: [ { name: "FANFOU_CONSUMER_KEY", description: "饭否 Consumer Key" }, { name: "FANFOU_CONSUMER_SECRET", description: "饭否 Consumer Secret" }, { name: "FANFOU_USERNAME", description: "饭否用户名" }, { name: "FANFOU_PASSWORD", description: "饭否密码" } ] }, handler }; async function handler() { if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) throw new ConfigNotFoundError("Fanfou RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config</a>"); return { title: "饭否热门话题", link: "https://fanfou.com/q/", description: "饭否热门话题", item: (await (await getFanfou()).get("/trends/list")).trends.map((item) => ({ title: item.name, description: item.name, link: item.url })), allowEmpty: true }; } //#endregion export { route };