rsshub
Version:
Make RSS Great Again!
37 lines (36 loc) • 1.19 kB
JavaScript
import { t as parseDate } from "./parse-date-Cr0wQjV_.mjs";
import { t as got_default } from "./got-BTowW50G.mjs";
import { load } from "cheerio";
//#region lib/routes/reactnewsletter/reactnewsletter.ts
const currentURL = "https://reactnewsletter.com/issues";
const route = {
path: "/",
categories: ["programming"],
example: "/reactnewsletter",
radar: [{
source: ["bytes.dev/issues", "bytes.dev/"],
target: ""
}],
name: "React Newsletter",
description: "Stay up to date on the latest React news, tutorials, resources, and more. Delivered every Tuesday, for free.",
maintainers: ["meixger"],
handler,
url: "bytes.dev/issues"
};
async function handler() {
const text = load((await got_default(currentURL)).data)("script#__NEXT_DATA__").text();
const items = JSON.parse(text).props.pageProps.issues.map((item) => ({
title: item.title,
pubDate: parseDate(item.date),
description: item.summary,
link: `/issues/${item.slug}`
}));
return {
title: "reactnewsletter.dev",
description: "Stay up to date on the latest React news, tutorials, resources, and more. Delivered every Tuesday, for free.",
link: currentURL,
item: items
};
}
//#endregion
export { route };