juejin
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesejuejin — read & publish on 掘金 via your own cookies
juejin — 使用自有Cookie在掘金上读写内容
Drives the user's real 掘金 account through the same web
endpoints the site uses, authenticated by the login cookie they captured with
the ACE extension. No browser, no third-party deps — just .
api.juejin.cnurllibThe connector injects the cookie jar as an env var:
- — a JSON array of cookies. Secret — never echo or print it.
JUEJIN_COOKIES
通过掘金官网使用的接口调用用户的真实掘金账号,使用用户通过ACE扩展捕获的登录Cookie进行身份验证。无需浏览器,无第三方依赖——仅使用。
api.juejin.cnurllib连接器会将Cookie Jar作为环境变量注入:
- — Cookie的JSON数组。机密内容——切勿回显或打印。
JUEJIN_COOKIES
CLI
CLI
The skill ships — self-contained, stdlib only.
scripts/juejin.pysh
JJ=$SKILL_DIR/scripts/juejin.py
python3 $JJ whoami # who is logged in (+ totals)
python3 $JJ articles --limit 20 # my published articles + stats
python3 $JJ article <article-id> # one article's statsStats come straight from 掘金: (阅读), (点赞),
(评论), (收藏). 2 = online.
view_countdigg_countcomment_countcollect_countaudit_status该工具附带了——独立脚本,仅依赖标准库。
scripts/juejin.pysh
JJ=$SKILL_DIR/scripts/juejin.py
python3 $JJ whoami # 查询当前登录用户信息(含统计数据)
python3 $JJ articles --limit 20 # 查看已发布文章及数据统计
python3 $JJ article <article-id> # 查看单篇文章的详细数据数据直接来自掘金:(阅读量)、(点赞数)、(评论数)、(收藏数)。为2表示已上线。
view_countdigg_countcomment_countcollect_countaudit_statusVerify the connection first
先验证连接有效性
sh
python3 $JJ whoamish
python3 $JJ whoami→ {"user_id": "...", "name": "...", "post_article_count": 336}
→ {"user_id": "...", "name": "...", "post_article_count": 336}
On an auth error (`err_no` 401 / "请登录") the cookie is expired — have the user
reconnect at <https://auth.acedata.cloud/user/connections>. Do **not** loop-retry.
若出现认证错误(`err_no`为401 / “请登录”),说明Cookie已过期——请用户前往<https://auth.acedata.cloud/user/connections>重新连接。**请勿循环重试。**Publishing — GATED (dry-run unless trailing --confirm
)
--confirm发布功能——受保护(除非末尾添加--confirm
,否则仅为试运行)
--confirmpublish--confirm--confirmsh
python3 $JJ publish --title "标题" --content-file a.md # dry-run
python3 $JJ publish --title "标题" --content-file a.md --draft-only --confirm # private draft
python3 $JJ publish --title "标题" --content-file a.md \
--category-id 6809637769959178254 --tag-ids 6809640407484334093 --confirm # PUBLIC- creates a private draft (掘金
--draft-only) — safe.article_draft - To actually publish (go through 审核), 掘金 requires a valid and at least one
--category-id. Without them, use--tag-idand let the user pick category/tags in the 掘金 editor. Default to--draft-only.--draft-only
publish--confirm--confirmsh
python3 $JJ publish --title "标题" --content-file a.md # 试运行
python3 $JJ publish --title "标题" --content-file a.md --draft-only --confirm # 发布为私有草稿
python3 $JJ publish --title "标题" --content-file a.md \
--category-id 6809637769959178254 --tag-ids 6809640407484334093 --confirm # 公开发布- 会创建私有草稿(掘金的
--draft-only)——安全无风险。article_draft - 要正式发布(进入审核流程),掘金要求提供有效的和至少一个
--category-id。若未提供这些参数,请使用--tag-id,让用户在掘金编辑器中选择分类和标签。默认使用--draft-only。--draft-only
Gotchas
注意事项
- This is the user's real 掘金 account. Confirm before any publish.
- Publishing without a category + tag is rejected in 审核; prefer .
--draft-only - Never print — it is full account access.
JUEJIN_COOKIES - ToS: acts only on the user's own account with their own captured cookie.
- 操作的是用户的真实掘金账号。发布前务必确认。
- 未指定分类和标签的发布请求会被审核驳回;优先使用。
--draft-only - 切勿打印——它拥有账号的完整访问权限。
JUEJIN_COOKIES - 服务条款:仅在用户自有账号上执行操作,且使用用户自行捕获的Cookie。
Record the output
记录输出结果
After you successfully publish and obtain the live result URL, call the built-in
tool ONCE so the user can track this deliverable in My Outputs:
publish_artifactpublish_artifact(kind="article", channel="juejin", title="<title>", url="<the REAL returned URL>", status="delivered")Use the real returned URL — never fabricate one. Call it once per published item,
only after delivery is confirmed; skip it (or use ) if publishing failed.
See .
status="failed"_shared/artifacts.md成功发布并获取文章的在线链接后,调用内置的工具一次,以便用户在“我的输出”中跟踪该成果:
publish_artifactpublish_artifact(kind="article", channel="juejin", title="<title>", url="<the REAL returned URL>", status="delivered")请使用真实返回的链接——切勿伪造。每发布一篇文章调用一次,仅在确认发布成功后调用;若发布失败,请跳过(或使用)。详情请查看。
status="failed"_shared/artifacts.md