rsshub
Version:
Make RSS Great Again!
65 lines (63 loc) • 1.76 kB
JavaScript
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 "./is-worker-DESPicPc.mjs";
import { t as cache_default } from "./cache-SV6W5EPy.mjs";
import "./helpers-Bo4JQYdN.mjs";
import { t as got_default } from "./got-CO-ndVl2.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 };