rsshub
Version:
Make RSS Great Again!
59 lines (57 loc) • 1.74 kB
JavaScript
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 "./cache-Bo__VnGm.mjs";
import "./helpers-DxBp0Pty.mjs";
import "./render-BQo6B4tL.mjs";
import "./got-KxxWdaxq.mjs";
import "./invalid-parameter-rr4AgGpp.mjs";
import { a as getTagSuggestion, c as parseDescription, i as getTagId, n as findAccountById, s as icon, t as baseUrl } from "./utils-DngYOT7p.mjs";
//#region lib/routes/fansly/tag.ts
const route = {
path: "/tag/:tag",
categories: ["social-media"],
example: "/fansly/tag/free",
parameters: { tag: "Hashtag" },
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false,
nsfw: true
},
radar: [{ source: ["fansly.com/explore/tag/:tag"] }],
name: "Hashtag",
maintainers: ["TonyRL"],
handler
};
async function handler(ctx) {
const tag = ctx.req.param("tag");
const suggestion = await getTagSuggestion(await getTagId(tag));
const items = suggestion.aggregationData?.posts.map((post) => {
const account = findAccountById(post.accountId, suggestion.aggregationData.accounts);
return {
title: post.content.split("\n")[0],
description: parseDescription(post, suggestion.aggregationData),
pubDate: parseDate(post.createdAt, "X"),
link: `${baseUrl}/post/${post.id}`,
author: `${account.displayName ?? account.username} (@${account.username})`
};
});
return {
title: `#${tag} - Fansly`,
link: `${baseUrl}/explore/tag/${tag}`,
image: icon,
icon,
logo: icon,
language: "en",
item: items
};
}
//#endregion
export { route };