UNPKG

rsshub

Version:
65 lines (63 loc) 1.76 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 { t as cache_default } from "./cache-Bo__VnGm.mjs"; import "./helpers-DxBp0Pty.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import { load } from "cheerio"; //#region lib/routes/literotica/new.ts const route = { path: "/new", categories: ["reading"], example: "/literotica/new", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false, nsfw: true }, radar: [{ source: ["literotica.com/"] }], name: "New Stories", maintainers: ["nczitzk"], handler, url: "literotica.com/" }; async function handler() { const currentUrl = `https://www.literotica.com/stories/new_submissions.php`; const $ = load((await got_default({ method: "get", url: currentUrl })).data); const list = $(".b-46t").toArray().map((item) => { item = $(item); const a = item.find(".p-48y"); return { title: a.text(), link: a.attr("href"), category: item.nextAll().eq(3).text().replaceAll(/\(|\)/g, "").trim(), pubDate: parseDate(item.nextAll().eq(4).text().trim(), "MM/DD/YY"), author: item.nextAll().eq(2).text().replace(/Submitted by/, "").trim() }; }); const items = await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => { item.description = load((await got_default({ method: "get", url: item.link })).data)(".aa_ht").html(); return item; }))); return { title: $("title").text(), link: currentUrl, item: items }; } //#endregion export { route };