📦 tencent-cloud-article-publisher — 技能工具

v1.0.0

将文章自动发布到腾讯云开发者社区 (https://cloud.tencent.com/developer)。需要提供:标题、正文(Markdown 或纯文本)、Cookie 认证信息。支持直接发布(addArticle API),无需打开浏览器。

0· 58·0 当前·0 累计
seanminjie 头像by @seanminjie (Seanminjie)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/4/4
0
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
The skill's code and instructions match its stated purpose (posting articles to cloud.tencent.com using a browser Cookie); nothing in the package is inconsistent or requesting unrelated credentials.
评估建议
This package appears internally consistent, but you should still be cautious because it requires your cloud.tencent.com login cookies. Before installing or running any scripts: (1) review publish_tencent.py and SKILL.md yourself (they are short and readable); (2) avoid pasting cookies into public channels — use a secure/private channel; (3) prefer using a throwaway or dedicated account if possible and revoke the session/cookie after use; (4) be aware that although the script claims to keep cooki...
详细分析 ▾
用途与能力
The name/description (publish articles to 腾讯云开发者社区) align with the included script and SKILL.md: both show calling the documented addArticle API and require a browser Cookie to authenticate. No unrelated services, credentials, or tools are requested.
指令范围
SKILL.md and publish_tencent.py stay within the publishing task: converting Markdown to HTML, building a payload, and POSTing to the documented API. The instructions ask the user to obtain Cookie values from browser DevTools and provide them at runtime — this is necessary for the stated purpose. The instructions do not direct reading other system files or exfiltrating data to third-party endpoints.
安装机制
There is no formal install spec (instruction-only), but an included install.sh copies SKILL.md and the publish_tencent.py into the user's home (~/.openclaw). The script itself is simple and readable. Note: running install.sh will write files into ~/.openclaw — this is expected but the user should verify contents before running.
凭证需求
The skill requests no environment variables or external credentials in metadata. Authentication is handled by a browser Cookie supplied at runtime, which is proportionate to the task. The package claims cookies are only kept in memory and not written to disk; the code provided does not persist the cookie file.
持久化与权限
The skill is not marked always:true, does not modify other skills or system-wide settings, and does not request persistent elevated privileges. The only side-effect of installation (if install.sh is run) is copying files into ~/.openclaw which is limited scope.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/4/4

Initial release of the Tencent Cloud article publisher skill: - Enables automatic article publishing to Tencent Cloud Developer Community via direct API. - Accepts title, Markdown or plain text content, and user-provided Cookie for authentication. - Converts Markdown to HTML for publishing; summary auto-generated if none provided. - No browser needed; articles are published immediately upon successful API call. - Ensures cookies are handled securely and only in memory; instructs users to retrieve cookies from browser DevTools. - Returns article link and publishing status after completion.

无害

安装命令

点击复制
官方npx clawhub@latest install tencent-cloud-article-publisher
镜像加速npx clawhub@latest install tencent-cloud-article-publisher --registry https://cn.longxiaskill.com

技能文档

将文章直接发布到腾讯云开发者社区。


已验证的 API

发布端点: POST https://cloud.tencent.com/developer/api/article/addArticle

已确认成功响应的 payload:

{
  "title": "文章标题",
  "content": "

HTML 格式正文内容

", "plain": "纯文本正文(不含 HTML 标签)", "summary": "文章摘要(自动生成或用户输入)", "userSummary": "用户填写的摘要", "sourceType": 1, "isOriginal": true, "classifyIds": [149], "openComment": 1, "closeTextLink": 0 }

成功响应: {"articleId":2650368,"status":0} → 文章立即发布成功,status=0 表示发布成功


发布流程

1. 转换内容格式

如果用户提供 Markdown → 转换为 HTML:

import re

def md_to_html(md_text): # 粗体 html = re.sub(r'\\(.+?)\\', r'\1', md_text) # 斜体 html = re.sub(r'\(.+?)\', r'\1', html) # 代码块 html = re.sub(r'(.+?)', r'\1', html) # 换行 html = re.sub(r'\n', '
', html) return f'

{html}

'

2. 直接调用 API

import requests
import json

def publish_article(title, content_md, cookie_str): """直接发布文章到腾讯云开发者社区""" # 1. 转换格式 content_html = md_to_html(content_md) plain_text = content_md # 纯文本 # 2. 构建摘要 summary = content_md[:100] + '...' if len(content_md) > 100 else content_md # 3. API 调用 url = "https://cloud.tencent.com/developer/api/article/addArticle" headers = { "Cookie": cookie_str, "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36", "Content-Type": "application/json", "Referer": "https://cloud.tencent.com/developer/article/write-new", "Origin": "https://cloud.tencent.com", } payload = { "title": title, "content": content_html, "plain": plain_text, "summary": summary, "userSummary": summary, "sourceType": 1, "isOriginal": True, "classifyIds": [149], # 149 = 技术 "openComment": 1, "closeTextLink": 0 } resp = requests.post(url, headers=headers, json=payload, timeout=15) result = resp.json() if "articleId" in result: article_id = result["articleId"] article_url = f"https://cloud.tencent.com/developer/article/{article_id}" return {"success": True, "articleId": article_id, "url": article_url} else: return {"success": False, "error": result.get("msg", "Unknown error")}

3. 获取 Cookie

用户需要从浏览器 DevTools 获取:

  • 打开 https://cloud.tencent.com/developer 并登录
  • 按 F12 → Application → Cookies → cloud.tencent.com
  • 复制以下 Cookie 字段的值,用分号连接:
- skey - qcloud_uid - qcommunity_session - loginType - qcommunity_identify_id - tinyid - uin(可选)


安全注意事项

  • Cookie 仅存内存:不写入任何文件,用完即弃
  • skey 包含特殊字符*):requests 库会自动处理,无需 URL 编码
  • 有效期:Cookie 会过期,发布失败时提示用户刷新 Cookie
  • 频率限制:每次发布间隔建议 > 10 秒

使用方式

用户说"帮我发布文章到腾讯云"时触发。收集:

  • Cookie(从飞书私密消息传递)
  • 文章标题
  • 文章正文(支持 Markdown)
  • 分类(可选,默认技术类)

返回发布结果 + 文章链接。

数据来源ClawHub ↗ · 中文优化:龙虾技能库