Juejin Publisher

v1.0.3

掘金文章自动发布技能。通过掘金官方 API(Cookie 鉴权),支持将 Markdown 文章一键发布到稀土掘金平台,支持设置分类、标签、摘要和封面图。

1· 358·1 current·1 all-time
by巫山老妖@devilwwj
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the included Python scripts which call api.juejin.cn to create drafts and publish articles. The only minor mismatch is that the SKILL.md metadata and registry metadata list 'curl' as a required binary while the provided scripts use Python's urllib and do not call curl — curl appears unnecessary but not malicious.
Instruction Scope
Runtime instructions explicitly say the skill will read a local juejin.env or environment variable to obtain the JUEJIN_COOKIE and then call the official 掘金 API endpoints. The scripts only read the declared config file / environment variables and the Markdown file to be published; they don't read other system files or contact unexpected external endpoints.
Install Mechanism
No install spec (instruction-only + shipped scripts). No external downloads or archive extraction. The package includes Python scripts and docs only — low install risk.
Credentials
The skill requires access to a login Cookie (JUEJIN_COOKIE), which is necessary for cookie-based auth to the 掘金 API and is described in SKILL.md. That credential is sensitive — but its use is proportionate to the stated purpose. The package also reads optional env vars for default category/tag IDs. The metadata did not list required env vars in the registry, but the SKILL.md documents which values are needed.
Persistence & Privilege
always is false and the skill does not attempt to modify other skills or global agent settings. It only reads a local config file in its own skill folder and environment variables; no elevated persistence or privileges are requested.
Assessment
This package appears to do exactly what it says: read a local juejin.env or JUEJIN_COOKIE environment variable and publish Markdown to api.juejin.cn. Before installing/using it, consider: 1) The JUEJIN_COOKIE is equivalent to a logged-in session — treat it as a secret. Only store it in secure, private locations and rotate/revoke it if you suspect compromise. 2) Test with --draft-only first to confirm behaviour. 3) The metadata unnecessarily lists curl as required even though the Python scripts don't use it — this is a minor inconsistency but not a security problem. 4) Review the scripts yourself (they are included) if you will run this in a shared or production environment. If you plan to run the skill in an environment accessible by others, avoid placing the Cookie in a world-readable file.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

⛏️ Clawdis
Binspython3, curl
latestvk97bfmhfn4e4g8b25da3197mj182v12g
358downloads
1stars
4versions
Updated 1mo ago
v1.0.3
MIT-0

掘金文章自动发布

本技能通过掘金官方 API,将 Markdown 文章自动发布到稀土掘金平台,无需打开浏览器,全程命令行完成。

⚙️ 快速配置

1. 获取掘金 Cookie

  1. 打开浏览器,登录 掘金
  2. F12 打开开发者工具 → Network 标签
  3. 随便点击一个请求(如 query_user_info
  4. 在 Request Headers 中找到 Cookie 字段,复制完整内容
  5. 将 Cookie 填入配置文件(见下方步骤 2)

⚠️ Cookie 有效期约 30 天,过期后需重新获取

2. 配置凭证文件

# 在 skill 根目录创建配置文件
cp /data/workspace/skills/juejin-publisher/juejin.env.example \
   /data/workspace/skills/juejin-publisher/juejin.env

# 编辑配置文件,填入你的 Cookie
nano /data/workspace/skills/juejin-publisher/juejin.env

配置文件内容:

# 掘金登录 Cookie(从浏览器 F12 获取)
JUEJIN_COOKIE="sessionid=xxx; ..."

# 默认分类 ID(可选,默认:后端)
# 常用分类 ID 见 references/category_ids.md
JUEJIN_DEFAULT_CATEGORY_ID="6809637769959178254"

# 默认标签 ID(逗号分隔,可选)
# 常用标签 ID 见 references/tag_ids.md
JUEJIN_DEFAULT_TAG_IDS="6809640408797167623"

🚀 使用指南

方式 A:智能助手(推荐)

直接对我说:

"帮我把 article.md 发布到掘金,分类是前端,标签是 Vue.js"

我会自动:

  1. 读取 juejin.env 获取 Cookie
  2. 解析 Markdown 文件的 frontmatter(标题、摘要、封面等)
  3. 调用掘金 API 创建草稿并发布
  4. 返回文章链接

方式 B:命令行脚本

# 赋予执行权限
chmod +x /data/workspace/skills/juejin-publisher/scripts/publish.py

# 基本用法(使用默认分类和标签)
python3 /data/workspace/skills/juejin-publisher/scripts/publish.py article.md

# 指定分类和标签
python3 /data/workspace/skills/juejin-publisher/scripts/publish.py article.md \
  --category "6809637767543259144" \
  --tags "6809640407484334093,6809640445233070094"

# 仅创建草稿,不发布
python3 /data/workspace/skills/juejin-publisher/scripts/publish.py article.md --draft-only

📝 Markdown 文件格式

文章顶部支持 frontmatter 元数据(可选):

---
title: 我的技术文章标题
description: 这里是文章摘要,建议 50-100 字,会显示在文章列表中
cover: https://example.com/cover.jpg
category_id: "6809637767543259144"
tag_ids: "6809640407484334093,6809640445233070094"
---

# 正文内容开始

这里是 Markdown 正文...

如果 frontmatter 中没有提供 title,脚本会自动取 Markdown 第一个 # 标题 作为文章标题。


📚 常用分类 ID

分类名称category_id
前端6809637767543259144
后端6809637769959178254
Android6809635626879549454
iOS6809635627209637895
AI6809637773935378440
工具6809637771511070734
阅读6809637772874219534

🏷️ 常用标签 ID

标签名称tag_id
Python6809640408797167623
JavaScript6809640407484334093
Vue.js6809640445233070094
React6809640407484334100
Go6809640408797167624
Docker6809640445233070095
AI6809640445233070096

完整标签列表见 references/tag_ids.md,或通过以下命令查询:

python3 /data/workspace/skills/juejin-publisher/scripts/query_tags.py "关键词"

🛠️ 故障排查

现象原因解决方案
err_no: 1Cookie 失效重新登录掘金并获取新 Cookie
brief_content 长度不符摘要太短或太长摘要需 50-100 字
category_id 无效分类 ID 错误参考上方常用分类 ID 表
tag_ids 无效标签 ID 错误运行 query_tags.py 查询正确 ID
文章重复标题已存在修改标题或删除掘金上的旧草稿

Comments

Loading comments...