xiaohongshu-skills  by autoclaw-cc

Browser automation for social media content operations

Created 1 week ago

New!

485 stars

Top 63.6% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a Python-based automation engine for Xiaohongshu (Little Red Book), enabling AI Agents and developers to programmatically interact with the platform. It addresses the need for automated content creation, discovery, and social engagement, targeting AI platforms like OpenClaw and Claude Code, as well as users requiring CLI automation for repetitive tasks. The primary benefit is the ability to control complex Xiaohongshu operations through natural language commands or scripts.

How It Works

The system employs a two-layer architecture. The top layer consists of SKILL.md files, which define the capabilities and intent routing for AI Agents, allowing them to understand and orchestrate Xiaohongshu tasks. The engine layer is a Python-based automation framework using the Chrome DevTools Protocol (CDP) to directly control a Google Chrome browser instance. This approach allows for robust interaction with the web application, including sophisticated anti-detection mechanisms and human-like behavior simulation.

Quick Start & Requirements

Installation involves placing the project directory into an AI Agent's skills folder (e.g., OpenClaw/skills/xiaohongshu-skills/) or cloning it directly. After placing the files, install Python dependencies using uv sync within the project directory.

  • Prerequisites: Python >= 3.11, uv package manager, Google Chrome browser.
  • Usage: Can be used directly via natural language prompts to compatible AI Agents or as a command-line interface (CLI) tool using scripts like scripts/cli.py and scripts/chrome_launcher.py.

Highlighted Details

  • Compound Operations: Supports natural language execution of multi-step workflows, such as searching for specific content, interacting with it, and summarizing findings.
  • Feature Rich: Encompasses authentication, content publishing (image/text, video, long-form articles), content discovery (search, feed exploration), and social interactions (liking, commenting, favoriting).
  • Anti-Detection: Implements Stealth JS injection, real CDP input events, and random delays to evade platform detection.
  • Maintainable Selectors: All CSS selectors are centralized in xhs/selectors.py, simplifying updates when Xiaohongshu's UI changes.
  • Data Extraction: Primarily relies on parsing window.__INITIAL_STATE__ for efficient data retrieval.

Licensing & Compatibility

The project is released under the MIT license. This permissive license generally allows for commercial use, modification, and distribution, including integration into closed-source applications.

Limitations & Caveats

This automation tool is dependent on the Google Chrome browser and the stability of the Chrome DevTools Protocol. Xiaohongshu's frequent UI updates may necessitate ongoing maintenance of the CSS selectors and automation logic. While anti-detection measures are in place, aggressive platform-side bot detection could still lead to account issues or operational failures.

Health Check
Last Commit

4 days ago

Responsiveness

Inactive

Pull Requests (30d)
16
Issues (30d)
23
Star History
499 stars in the last 10 days

Explore Similar Projects

Starred by Will Brown Will Brown(Research Lead at Prime Intellect), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
16 more.

stagehand by browserbase

0.4%
21k
AI browser automation framework for production
Created 1 year ago
Updated 1 day ago
Feedback? Help us improve.