UNPKG

rsshub

Version:
40 lines (38 loc) 1.09 kB
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import "./logger-C4avouvV.mjs"; import "./ofetch-DKl_Ma9g.mjs"; import { t as parseDate } from "./parse-date-r5WDWHno.mjs"; import "./helpers-Bo4JQYdN.mjs"; import { t as got_default } from "./got-CO-ndVl2.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 };