rsshub
Version:
Make RSS Great Again!
53 lines (51 loc) • 1.7 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import { t as config } from "./config-C37vj7VH.mjs";
import { t as ViewType } from "./types-D84BRIt4.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import "./parse-date-BrP7mxXf.mjs";
import "./cache-Bo__VnGm.mjs";
import "./helpers-DxBp0Pty.mjs";
import "./render-BQo6B4tL.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import { t as config_not_found_default } from "./config-not-found-Dyp3RlZZ.mjs";
import { t as utils_default } from "./utils-GeEoF2-w.mjs";
//#region lib/routes/misskey/featured-notes.ts
const route = {
path: "/notes/featured/:site",
categories: ["social-media"],
view: ViewType.SocialMedia,
example: "/misskey/notes/featured/misskey.io",
parameters: { site: "instance address, domain only, without `http://` or `https://` protocol header" },
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
name: "Featured Notes",
maintainers: ["Misaka13514"],
handler
};
async function handler(ctx) {
const site = ctx.req.param("site");
if (!config.feature.allow_user_supply_unsafe_domain && !utils_default.allowSiteList.includes(site)) throw new config_not_found_default(`This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`);
const list = (await got_default({
method: "post",
url: `https://${site}/api/notes/featured`,
json: {
limit: 10,
offset: 0
}
})).data;
return {
title: `Featured Notes on ${site}`,
link: `https://${site}/explore`,
item: utils_default.parseNotes(list, site)
};
}
//#endregion
export { route };