Skip to content

ZJU-REAL/Easel / skills/builtin/skill-xhs-analyzer

redbook

Flagged

小红书内容分析:搜索笔记、拉取互动数据、分析爆款规律、创作者画像、限流检测,支持 CLI 自动化操作。 当用户说"小红书数据分析""小红书爆款分析""笔记数据""小红书限流检测""小红书创作者画像""分析小红书账号"时使用。 发布与日常互动运营请用 skill-xhs-publisher。

FileKindSize
.github/workflows/npm-publish.ymlconfig3.8 KB
EASEL-META.mdmarkdown2.1 KB
SKILL.mdskill md5.2 KB
package-lock.jsonmanifest36.6 KB
package.jsonmanifest1.6 KB
references/commands.mdmarkdown4.4 KB
references/modules.mdmarkdown6.2 KB
references/platform-signals.mdmarkdown1.7 KB
references/research-loop.mdmarkdown8.2 KB
references/technical-reference.mdmarkdown3.8 KB
scripts/postinstall.jsscript4.5 KB
scripts/preuninstall.jsscript1.4 KB
social-preview.htmlother5.1 KB
social-preview.pngbinary261.4 KB
src/cli.tsscript76.8 KB
src/lib/analyze.tsscript20.0 KB
src/lib/cdp-cookies.tsscript13.1 KB
src/lib/client.tsscript22.2 KB
src/lib/cookies.tsscript13.3 KB
src/lib/creator-signing.tsscript1.8 KB
src/lib/detect.tsscript6.6 KB
src/lib/fingerprint-data.tsscript2.3 KB
src/lib/health.tsscript5.5 KB
src/lib/platform.tsscript2.7 KB
src/lib/render.tsscript19.5 KB
src/lib/reply-strategy.tsscript6.0 KB
src/lib/signing.tsscript21.1 KB
src/lib/template.tsscript8.0 KB
src/lib/url.tsscript1.8 KB
tsconfig.jsonconfig458 B

src/lib/platform.ts

View on GitHub
/**
 * Platform configuration — Xiaohongshu (mainland) vs RedNote (global).
 *
 * XHS runs two separate backends that do NOT share sessions:
 *  - Mainland Xiaohongshu:  xiaohongshu.com / edith.xiaohongshu.com, cookies on .xiaohongshu.com
 *  - Global RedNote:        rednote.com     / edith.rednote.com,     cookies on .rednote.com
 *
 * The web signing algorithm (x-s/x-t) is shared — only hosts, cookie domain,
 * and the fingerprint `location` differ. This module makes those swappable so
 * the same client can talk to either backend.
 */

export type PlatformId = "xhs" | "rednote";

export interface PlatformConfig {
  id: PlatformId;
  /** Main read/write API host (signed x-s/x-t endpoints). */
  edithHost: string;
  /** Creator backend host (posting, analytics, note health). */
  creatorHost: string;
  /** Web home origin — used for origin/referer headers and display URLs. */
  homeUrl: string;
  /** Image/video upload host. */
  uploadHost: string;
  /** URL handed to the cookie extractor to select the right cookie domain. */
  cookieUrl: string;
  /** Value embedded as the fingerprint `location` in the signing payload. */
  signLocation: string;
}

export const PLATFORMS: Record<PlatformId, PlatformConfig> = {
  xhs: {
    id: "xhs",
    edithHost: "https://edith.xiaohongshu.com",
    creatorHost: "https://creator.xiaohongshu.com",
    homeUrl: "https://www.xiaohongshu.com",
    uploadHost: "https://ros-upload.xiaohongshu.com",
    cookieUrl: "https://www.xiaohongshu.com/",
    signLocation: "https://www.xiaohongshu.com/explore",
  },
  rednote: {
    id: "rednote",
    // Global RedNote serves the signed /api/sns/web/* endpoints from webapi.rednote.com
    // (there is no edith.rednote.com). Verified against /api/sns/web/v2/user/me.
    edithHost: "https://webapi.rednote.com",
    creatorHost: "https://creator.rednote.com",
    homeUrl: "https://www.rednote.com",
    uploadHost: "https://ros-upload.rednote.com",
    cookieUrl: "https://www.rednote.com/",
    signLocation: "https://www.rednote.com/explore",
  },
};

/**
 * Resolve a platform config from an explicit id, the REDBOOK_PLATFORM env var,
 * or the default (xhs). Accepts "global" as an alias for "rednote".
 * Host env overrides (REDBOOK_EDITH_HOST / REDBOOK_CREATOR_HOST) are honored
 * for probing/testing alternate API hosts.
 */
export function resolvePlatform(explicit?: string): PlatformConfig {
  const raw = (explicit || process.env.REDBOOK_PLATFORM || "xhs").toLowerCase();
  const base =
    raw === "rednote" || raw === "global" ? PLATFORMS.rednote : PLATFORMS.xhs;
  return {
    ...base,
    edithHost: process.env.REDBOOK_EDITH_HOST || base.edithHost,
    creatorHost: process.env.REDBOOK_CREATOR_HOST || base.creatorHost,
  };
}
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall