UNPKG

rsshub

Version:
18 lines (17 loc) 880 B
import { t as rofetch } from "./ofetch-C3ts-Hud.mjs"; import { t as parseDate } from "./parse-date-Cr0wQjV_.mjs"; import { load } from "cheerio"; //#region lib/routes/agirls/utils.ts const baseUrl = "https://agirls.aotter.net"; const parseArticle = async (item) => { const content = load(await rofetch(item.link)); item.category = [...new Set(content(".ag-article__tag").toArray().map((e) => content(e).text().replace("#", "")))]; const newsArticle = JSON.parse(content("script[type=\"application/ld+json\"]").text())["@graph"].find((g) => g["@type"] === "NewsArticle"); item.description = content(".ag-article__content").html(); item.pubDate = parseDate(newsArticle.datePublished); item.updated = parseDate(newsArticle.dateModified); item.author = newsArticle.author.map((a) => a.name).join(", "); return item; }; //#endregion export { parseArticle as n, baseUrl as t };