rsshub
Version:
Make RSS Great Again!
31 lines (30 loc) • 870 B
JavaScript
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs";
import { t as parseDate } from "./parse-date-CjhZE69i.mjs";
//#region lib/routes/daxiaamu/home.ts
const route = {
path: "/home",
categories: ["blog"],
example: "/daxiaamu/home",
radar: [{ source: ["www.daxiaamu.com/"] }],
name: "首页",
maintainers: ["kt286"],
handler,
url: "www.daxiaamu.com/"
};
async function handler() {
const baseUrl = "https://www.daxiaamu.com";
return {
title: "大侠阿木博客",
description: "杂七杂八技术博客",
link: baseUrl,
item: (await rofetch(`${baseUrl}/wp-json/wp/v2/posts`, { query: { _embed: "" } })).map((item) => ({
title: item.title.rendered,
description: item.content.rendered,
pubDate: parseDate(item.date_gmt),
link: item.link,
author: item._embedded.author.map((a) => a.name).join(", ")
}))
};
}
//#endregion
export { route };