rsshub
Version:
Make RSS Great Again!
47 lines (45 loc) • 1.22 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import { t as parseDate } from "./parse-date-BrP7mxXf.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
//#region lib/routes/abmedia/index.ts
const rootUrl = "https://www.abmedia.io";
const postsAPIUrl = `${rootUrl}/wp-json/wp/v2/posts`;
const route = {
path: "/index",
categories: ["new-media"],
example: "/abmedia/index",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["www.abmedia.io/"] }],
name: "首页最新新闻",
maintainers: [],
handler,
url: "www.abmedia.io/"
};
async function handler(ctx) {
const url = `${postsAPIUrl}?per_page=${ctx.req.param("limit") ?? 10}`;
return {
title: "ABMedia - 最新消息",
link: rootUrl,
item: (await got_default.get(url)).data.map((item) => ({
title: item.title.rendered,
link: item.link,
description: item.content.rendered,
pubDate: parseDate(item.date)
}))
};
}
//#endregion
export { route };