weibo

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

weibo — read & post on 微博 via your own cookies

weibo — 通过自身Cookie读取和发布微博

Drives the user's real 微博 account through the same
weibo.com/ajax
web API the site uses, authenticated by the login cookie they captured with the ACE extension. No browser, no third-party deps — just
urllib
.
⚠️ Not yet E2E-verified. Unlike the other cookie skills (csdn / juejin / bilibili / medium), this one was built from the documented web API but could not be tested against a live account (no 微博 connection existed at build time). The first live run is the verification; if an endpoint shape drifted it will surface as a clear error rather than silent breakage.
The connector injects the cookie jar as an env var:
  • WEIBO_COOKIES
    — a JSON array of cookies. Secret — never echo or print it. Writes send the
    XSRF-TOKEN
    cookie as both the
    x-xsrf-token
    header and the
    st
    form field (the CLI does this for you).
通过网站使用的同款
weibo.com/ajax
Web API操作用户的真实微博账号,通过用户使用ACE扩展捕获的登录Cookie进行身份验证。无需浏览器,无需第三方依赖——仅使用
urllib
⚠️ 尚未完成端到端验证。 与其他基于Cookie的技能(csdn / 掘金 / bilibili / medium)不同,本技能基于公开文档的Web API构建,但无法在真实账号上进行测试(构建时无可用的微博连接)。首次实际运行即为验证过程;若接口结构发生变化,会明确抛出错误而非静默失效。
连接器将Cookie Jar作为环境变量注入:
  • WEIBO_COOKIES
    — Cookie的JSON数组。保密内容——切勿回显或打印。 发布内容时,会将
    XSRF-TOKEN
    Cookie同时作为
    x-xsrf-token
    请求头和
    st
    表单字段发送(CLI会自动完成此操作)。

CLI

CLI

The skill ships
scripts/weibo.py
— self-contained, stdlib only.
sh
WB=$SKILL_DIR/scripts/weibo.py
python3 $WB whoami                       # who is logged in (+ counts)
python3 $WB posts --limit 20             # my recent 微博 + engagement
Engagement comes straight from 微博:
reposts_count
(转发),
comments_count
(评论),
attitudes_count
(赞).
本技能附带
scripts/weibo.py
——独立脚本,仅依赖标准库。
sh
WB=$SKILL_DIR/scripts/weibo.py
python3 $WB whoami                       # 查询当前登录用户(及相关统计数据)
python3 $WB posts --limit 20             # 查看我的近期微博及互动数据
互动数据直接来自微博:
reposts_count
(转发)、
comments_count
(评论)、
attitudes_count
(赞)。

Verify the connection first

先验证连接

sh
python3 $WB whoami
sh
python3 $WB whoami

→ {"uid": "...", "name": "...", "statuses_count": ...}

→ {"uid": "...", "name": "...", "statuses_count": ...}


On an auth error the cookie is expired — have the user reconnect at
<https://auth.acedata.cloud/user/connections>. Do **not** loop-retry.

若出现身份验证错误,说明Cookie已过期——请用户前往<https://auth.acedata.cloud/user/connections>重新连接。**请勿循环重试**。

Posting — GATED (dry-run unless trailing
--confirm
)

发布微博 — 受保护(仅在末尾添加
--confirm
时才会实际发布,否则为试运行)

微博 are short-form, so there is no draft step — a confirmed post goes live. Without a trailing
--confirm
it dry-runs.
--confirm
is honored only as the last argument. Always show the dry-run, get an explicit "yes", then re-run.
sh
python3 $WB post --content "你好,这是一条微博"            # dry-run
python3 $WB post --content "你好,这是一条微博" --confirm   # PUBLIC 微博 (immediate)
  • There is no draft and no private mode on 微博 — a confirmed post is immediately public. Always show the dry-run and get explicit approval of the exact text before adding
    --confirm
    .
微博属于短内容形式,因此无草稿步骤——确认发布后内容立即上线。若未在末尾添加
--confirm
,则为试运行。
--confirm
仅在作为最后一个参数时生效。请始终先展示试运行结果,获得用户明确的“同意”后,再重新运行命令。
sh
python3 $WB post --content "你好,这是一条微博"            # 试运行
python3 $WB post --content "你好,这是一条微博" --confirm   # 发布公开微博(立即生效)
  • 微博无草稿模式和私密模式——确认发布的内容会立即变为公开状态。在添加
    --confirm
    前,请始终展示试运行结果,并获得用户对确切文本的明确批准。

Gotchas

注意事项

  • This is the user's real 微博 account. Confirm before any post — it is immediate and public by default.
  • Not E2E-verified (see the warning above) — expect to validate the first run.
  • Never print
    WEIBO_COOKIES
    — it is full account access.
  • ToS: acts only on the user's own account with their own captured cookie.
  • 操作的是用户的真实微博账号。发布任何内容前请确认——默认情况下内容会立即公开。
  • 尚未完成端到端验证(见上方警告)——首次运行时需进行验证。
  • 切勿打印
    WEIBO_COOKIES
    ——它拥有账号的完全访问权限。
  • 服务条款(ToS):仅在用户自身账号上操作,且使用用户自行捕获的Cookie。