Logo: Weibo Hub

Weibo Hub

Organisatioun
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.

Iwwersiicht

EditeurOpenMinis
RepositoryMinisSkills
Skill-Nummweibo-hub
Stären
543
Forks
86
Matgeliwwert Dateien
7
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 7 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    OpenMinis huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Weibo Hub an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/OpenMinis/MinisSkills/tree/main/weibo-hub
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Weibo Hub an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Weibo Hub automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Weibo Hub net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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 req...

Firwat Weibo Hub op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Weibo Hub besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Weibo Hub an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/OpenMinis/MinisSkills/tree/main/weibo-hub an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Weibo Hub benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Weibo Hub benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Weibo Hub domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Weibo Hub gratis?

Jo. OpenMinis huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇