rsshub
Version:
Make RSS Great Again!
31 lines (30 loc) • 979 B
JavaScript
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs";
import { t as parseDate } from "./parse-date-CjhZE69i.mjs";
//#region lib/routes/idownloadblog/index.ts
const route = {
path: "/",
categories: ["new-media"],
example: "/idownloadblog",
description: "Provides a better reading experience (full text articles) over the official one.",
name: "blog",
maintainers: ["HenryQW"],
handler
};
async function handler(ctx) {
const baseUrl = "https://www.idownloadblog.com";
return {
title: "iDownloadBlog",
link: baseUrl,
description: "iDownloadBlog",
item: (await rofetch(`${baseUrl}/wp-json/wp/v2/posts`, { query: { per_page: ctx.req.query("limit") === "10" ? void 0 : ctx.req.query("limit") } })).map((item) => ({
title: item.title.rendered,
description: item.content.rendered,
pubDate: parseDate(item.date_gmt),
updated: parseDate(item.modified_gmt),
link: item.link,
author: item.yoast_head_json?.author
}))
};
}
//#endregion
export { route };