返回顶部
b

bear-blog-publisherBear博客发布

Publish blog posts to Bear Blog platform. Supports user-provided markdown, AI-generated content, and auto-generated diagrams.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.13
安全检测
已通过
791
下载量
免费
免费
2
收藏
概述
安装方式
版本历史

bear-blog-publisher

Bear Blog 发布器

将博客文章发布到 Bear Blog (https://bearblog.dev/)。

概述

该技能为 Bear Blog 提供自动化发布功能,包括可选的 AI 内容生成和图表生成。

认证方式(选择其一)

方式一:OpenClaw 配置(推荐个人使用)

添加到 ~/.openclaw/openclaw.json:

json
{
skills: {
bear-blog-publisher: {
email: your@email.com,
password: yourpassword
}
}
}

安全性:文件权限应设置为 600(仅所有者可读)。

方式二:环境变量(推荐 CI/CD 使用)

bash
export BEARBLOGEMAIL=your@email.com
export BEARBLOGPASSWORD=yourpassword

安全性:凭据仅存在于内存中,不会写入磁盘。

方式三:运行时参数(推荐多用户使用)

调用技能时提供凭据:

python
publisher = BearBlogPublisher(email=user@example.com, password=secret)

安全性:调用方(聊天机器人、Web 应用等)管理凭据生命周期。

AI 内容生成(可选)

要使用 AI 内容生成,请配置以下之一:

OpenAI

bash
export OPENAIAPIKEY=sk-...

Kimi

bash
export KIMIAPIKEY=your-kimi-api-key

使用方式

python
publisher = BearBlogPublisher()
content = publisher.generate_content(
topic=Python best practices,
provider=openai, # 或 kimi
tone=professional,
length=medium
)
result = publisher.publish(title=My Post, content=content)

优先级顺序

  1. 1. 运行时参数(最高优先级)
  2. 环境变量
  3. OpenClaw 配置(最低优先级)

功能

1. 发布博客文章

输入:

  • - title(字符串):博客文章标题
  • content(字符串):Markdown 内容
  • email(字符串,可选):Bear Blog 邮箱
  • password(字符串,可选):Bear Blog 密码

输出:

  • - 已发布的 URL 或错误信息

2. AI 内容生成(可选)

使用 OpenAI 或 Kimi API 生成博客内容。

3. 生成图表(可选)

针对技术主题,使用 HTML/CSS + Playwright 生成架构图。

安全最佳实践

  1. 1. 切勿将凭据提交到 git
  2. 在生产环境中使用环境变量
  3. 将配置文件权限设置为 600
  4. 在多用户场景中使用运行时参数

安全注意事项

该技能做出了一些用户应了解的操作选择:

1. Playwright 浏览器下载

  • - 原因:需要用于生成 PNG 格式的架构图
  • 大小:约 100MB 的 Chromium 浏览器
  • 替代方案:如不需要,可跳过图表生成

2. 临时文件

  • - 位置:/tmp/diagram.html 和 /tmp/diagram.png
  • 用途:图表生成的中间文件
  • 清理:每次运行时文件会被覆盖,不会显式删除

3. --no-sandbox 标志

  • - 原因:需要在容器化/Docker 环境中运行 Chromium
  • 风险:浏览器隔离性略有降低
  • 缓解措施:仅用于本地 HTML 转图片,不加载外部 URL

4. 明文密码存储(可选)

  • - 配置文件:仅当用户选择方式一时
  • 建议:改用环境变量(方式二)或运行时参数(方式三)
  • 如使用配置文件:始终将文件权限设置为 600

使用示例

使用配置文件

bash

已配置 ~/.openclaw/openclaw.json


你:发布一篇关于 Python 技巧的博客
AI:[使用配置文件凭据,发布]

使用环境变量

bash
export BEARBLOGEMAIL=user@example.com
export BEARBLOGPASSWORD=secret

你:发布一篇关于 Python 技巧的博客
AI:[使用环境变量,发布]

使用 AI 内容生成

bash
export BEARBLOGEMAIL=user@example.com
export BEARBLOGPASSWORD=secret
export OPENAIAPIKEY=sk-...

你:撰写并发布一篇关于 Python asyncio 的博客
AI:[使用 OpenAI 生成内容,发布]

使用运行时参数

python

在你的聊天机器人代码中


email = getuseremail() # 询问用户
password = getuserpassword() # 询问用户

publisher = BearBlogPublisher(email=email, password=password)
result = publisher.publish(title=My Post, content=# Content)

实现

  • - 使用 Bear Blog Web API
  • CSRF 令牌认证
  • 基于会话(无持久存储)
  • 使用 Playwright 生成图表
  • 使用 OpenAI/Kimi API 生成内容

许可证

MIT

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 bear-blog-publisher-1776419956 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 bear-blog-publisher-1776419956 技能

通过命令行安装

skillhub install bear-blog-publisher-1776419956

下载

⬇ 下载 bear-blog-publisher v1.0.13(免费)

文件大小: 12.98 KB | 发布时间: 2026-4-17 18:28

v1.0.13 最新 2026-4-17 18:28
- No file changes detected in this version.
- Documentation and feature set remain unchanged from the previous release.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部