Weibo Hub logo

Weibo Hub

Organization
OpenMinis
weibo-hub

A skill for reading and writing Weibo data with Python + UV. It depends only on httpx and uses `browser_use get_cookies` to automatically retrieve cookies and complete authentication, with no manual copying required. It supports trending searches, popular feeds, following feeds, keyword search, Weibo post details/comments/reposts, user profiles/posts/following/follower lists, and more. This skill must be triggered whenever the user mentions "Weibo", "weibo", "weibo-hub", "Weibo trending searches", "scraping Weibo", "searching Weibo", "Weibo comments", "Weibo users", or any scenario that requires programmatic reading or writing of Weibo data.

Overview

PublisherOpenMinis
RepositoryMinisSkills
Skill nameweibo-hub
Stars
543
Forks
86
Bundled files
7
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by OpenMinis on GitHub. Read the source before you install it.

Installation

Install the Weibo Hub AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/OpenMinis/MinisSkills/tree/main/weibo-hub
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OpenMinis/MinisSkills.git /tmp/MinisSkills
mkdir -p .claude/skills
cp -r /tmp/MinisSkills/weibo-hub .claude/skills/weibo-hub
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Weibo Hub in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Weibo Hub on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Weibo Hub is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

weibo-hub

Adapted from: jackwener/weibo-cli (Apache-2.0)

This skill streamlines the original repository as follows:

  • Removed the click / rich / browser-cookie3 / qrcode / pyyaml dependencies
  • Kept only httpx as a third-party dependency
  • Removed the CLI layer; all functionality is encapsulated as a synchronous Python API
  • Changed authentication to extracting cookies with browser_use get_cookies, then calling setup_credential() to save them
  • Changed the data directory to /var/minis/workspace/weibo-hub/

File Structure

/var/minis/skills/weibo-hub/
├── SKILL.md
├── pyproject.toml          # httpx only
└── scripts/
    ├── __init__.py
    ├── constants.py        # API endpoints, headers, and path constants
    ├── exceptions.py       # WeiboError exception hierarchy
    ├── auth.py             # Credential persistence (no browser-cookie3)
    └── client.py           # WeiboClient core class (all APIs)

Authentication Flow (Check Before Each Use)

weibo-hub uses browser cookie authentication, extracted from weibo.com with browser_use get_cookies. It does not require browser-cookie3 or QR code scanning.

Step 1: Use browser_use to Extract Cookies

python
# Call in the agent:
browser_use(action="navigate", url="https://weibo.com")
# After confirming you are logged in:
browser_use(action="get_cookies", url="https://weibo.com")
# Record the returned offload env file path

Step 2: Read and Save Credentials from the env File

python
import sys, os, subprocess, json

# Load Cookie environment variables (the path comes from the offload file returned by get_cookies)
env_file = "/var/minis/offloads/env_cookies_xxx.sh"   # Replace with the actual path
result = subprocess.run(
    f". {env_file} && python3 -c \"import os,json; print(json.dumps(dict(os.environ)))\"",
    shell=True, capture_output=True, text=True
)
env = json.loads(result.stdout)

# Parse the Cookie dictionary (variables with the COOKIE_ prefix)
cookies = {
    k[len("COOKIE_"):]: v
    for k, v in env.items()
    if k.startswith("COOKIE_")
}

# Save credentials
sys.path.insert(0, "/var/minis/skills/weibo-hub")
from scripts.client import WeiboClient
WeiboClient.setup_credential(cookies)

Required Cookies: SUB, SUBP (required). The more additional cookies, the better. Credentials are saved to /var/minis/workspace/weibo-hub/credential.json, valid for 7 days, and an expiration prompt is shown automatically when they expire.


Environment Setup

bash
cd /var/minis/skills/weibo-hub
uv sync

Quick Start

python
import sys
sys.path.insert(0, "/var/minis/skills/weibo-hub")
from scripts.client import WeiboClient

with WeiboClient() as client:

    # ── Trending searches / trends (no login required)──────────────────────────────
    topics = client.hot_search()          # Trending search list (~52 entries)
    for t in topics[:10]:
        print(f"#{t.get('realtime_hot_show_label','')} {t.get('word','')}")

    band = client.hot_band()              # Full trending search list
    trends = client.trending()            # Real-time search suggestions

    # ── Feeds (popular requires no login; following requires login)─────────────────────
    hot = client.hot_feed(count=10)       # Popular timeline
    home = client.home_feed(count=20)     # Following timeline

    # ── Search (mobile API)────────────────────────────────────
    results = client.search("Artificial Intelligence", page=1)
    for w in results[:5]:
        print(w.get("text", "")[:80])

    # ── Weibo post details / comments / reposts (login required)──────────────────
    wb = client.detail("Qw06Kd98p")
    cmt = client.comments("WeiboID", count=20)
    rep = client.reposts("WeiboID", count=10)

    # ── Users (login required)─────────────────────────────────────
    me = client.me()                      # Currently logged-in user
    user = client.profile("1699432410")   # Specified user profile
    weibos = client.user_weibos("1699432410", page=1)
    following = client.following("1699432410", page=1)
    followers = client.followers("1699432410", page=1)

API Quick Reference

No Login Required (Public APIs)

MethodDescription
hot_search()Trending search sidebar (~52 entries)
hot_band()Full trending search list
trending()Real-time search suggestions
hot_feed(count, max_id)Popular timeline
search(keyword, page)Keyword search for Weibo posts

Login Required (Cookie Authentication)

MethodDescription
me()Current logged-in user information
home_feed(count, max_id)Following timeline
detail(mblogid)Details for a single Weibo post
comments(weibo_id, count, max_id)Weibo comment list
reposts(weibo_id, page, count)Weibo repost list
profile(uid)User profile
user_weibos(uid, page, count)User's Weibo post list
following(uid, page)User following list
followers(uid, page)User follower list

Authentication

MethodDescription
WeiboClient.setup_credential(cookies)Save Cookie credentials (static method)

Anti-Abuse Notes

Consistent with the upstream weibo-cli:

  • Gaussian jitter: Interval between requests = request_delay + gauss(0.3, 0.15), about 1 s
  • 5% long pause: Randomly triggers an additional 2-5 s delay to simulate reading behavior
  • Exponential backoff: HTTP 429/5xx retries up to 3 times, with a wait time of 2^n seconds
  • Chrome 145 UA: Desktop User-Agent, consistent with the browser fingerprint

Notes

  • Before first use, you must call WeiboClient.setup_credential(cookies) to save credentials
  • Credential file: /var/minis/workspace/weibo-hub/credential.json, permissions 0600
  • Required Cookies: SUB + SUBP; if missing, setup_credential() throws ValueError
  • Cookies automatically prompt as expired after 7 days and must be extracted again
  • Trending searches, popular feeds, and search do not require login; profile, detail, home_feed, and similar methods require valid cookies
  • search() uses the mobile API (m.weibo.cn), and the result format is slightly different

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Weibo Hub AI skill do?

A skill for reading and writing Weibo data with Python + UV. It depends only on httpx and uses `browser_use get_cookies` to automatically retrieve cookies and complete authentication, with no manual copying required. It supports trending searches, popular feeds, following feeds, keyword search, Weibo post details/comments/reposts, user profiles/posts/following/follower lists, and more. This skill must be triggered whenever the user mentions "Weibo", "weibo", "weibo-hub", "Weibo trending searches", "scraping Weibo", "searching Weibo", "Weibo comments", "Weibo users", or any scenario that req...

Why use Weibo Hub on TypingMind?

Because you install it once and use it with any model. Weibo Hub is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Weibo Hub in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/OpenMinis/MinisSkills/tree/main/weibo-hub. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Weibo Hub?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Weibo Hub?

As many as you like. As long as a model supports skills, you can use Weibo Hub with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Weibo Hub AI skill free?

Yes. It is published on GitHub by OpenMinis under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇