rsshub
Version:
Make RSS Great Again!
22 lines (20 loc) • 641 B
JavaScript
import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs";
import { t as parseDate } from "./parse-date-BrP7mxXf.mjs";
//#region lib/routes/jamesclear/utils.ts
const rootUrl = "https://jamesclear.com";
const apiUrl = `${rootUrl}/wp-json/wp/v2`;
async function fetchContent(endpoint) {
return await ofetch_default(`${apiUrl}/${endpoint}`);
}
function processItem(item) {
return {
title: item.title.rendered,
link: item.link,
description: item.content.rendered,
pubDate: parseDate(item.date_gmt),
author: "James Clear",
guid: item.guid.rendered
};
}
//#endregion
export { processItem as n, rootUrl as r, fetchContent as t };