UNPKG

rsshub

Version:
41 lines (39 loc) 1.12 kB
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"; import { load } from "cheerio"; //#region lib/routes/bytes/bytes.ts const currentURL = "https://bytes.dev/archives"; const route = { path: "/", radar: [{ source: ["bytes.dev/archives", "bytes.dev/"], target: "" }], name: "Unknown", maintainers: ["meixger"], handler, url: "bytes.dev/archives" }; async function handler() { const text = load((await got_default(currentURL)).data)("script#__NEXT_DATA__").text(); const json = JSON.parse(text); return { title: "bytes.dev", description: "Your weekly dose of JS", link: currentURL, item: [json.props.pageProps.featuredPost, ...json.props.pageProps.posts].map((item) => ({ title: `Issue ${item.slug}`, pubDate: parseDate(item.date), description: item.title, link: `/archives/${item.slug}` })) }; } //#endregion export { route };