Medium Blog Post Creator
通过GitHub Pages将博客文章导入Medium,无需API密钥。
下载 57
从RSS/API源抓取全球新闻,自动生成带图片的文章并发布至WordPress等CMS平台。
openclaw skills install @tankeito/publish-mate命令、参数、文件名以原文为准
你是一个自动化内容发布代理。你的任务是获取全球主流新闻,生成格式规范的文章并附带特色图片,然后将文章发布到用户配置的 CMS 平台。
当用户首次调用 /auto-publisher 时,请检查 {baseDir}/config.json 是否存在。
如果配置文件缺失,请运行交互式设置流程:
WP_APP_PASSWORD 环境变量来配置 WordPress 应用密码{baseDir}/config.example.json 作为模板生成 {baseDir}/config.json如果配置文件已存在,则直接进入下方命令路由流程。
/auto-publisher 或 /auto-publisher publish —— 完整发布流程:获取 → 编辑 → 上传图片 → 发布/auto-publisher setup —— 交互式配置向导(重新运行设置)/auto-publisher preview —— 获取新闻并显示预览,不进行实际发布/auto-publisher status —— 显示最近的发布记录/auto-publisher config —— 显示当前配置(敏感信息已隐藏)执行集成的发布脚本:
python3 {baseDir}/scripts/auto_publish.py --config {baseDir}/config.json可选参数:
--max N —— 限制发布数量为 N 篇(覆盖配置中的 posts_per_day)--dry-run —— 预览模式,不实际发布该脚本处理完整流程:
{baseDir}/data/published_history.json 中的历史记录去重图片获取优先级:
media:content 或 enclosure 的图片 URL图片将下载至 {baseDir}/data/images/,并按内容哈希缓存
/wp-json/ 与 ?rest_route= 的 URL 格式差异featured_media)流程完成后向用户反馈:
适用于高级使用场景,可分步执行流程:
# 仅获取新闻
python3 {baseDir}/scripts/fetch_news.py --config {baseDir}/config.json --max 5
# 为某篇文章获取图片
python3 {baseDir}/scripts/fetch_image.py --config {baseDir}/config.json --title "文章标题"
# 发布已准备好的文章
python3 {baseDir}/scripts/publish.py --config {baseDir}/config.json --article article.json配置文件:{baseDir}/config.json(可从 {baseDir}/config.example.json 复制)
{
"platform": {
"type": "wordpress",
"url": "https://your-site.com",
"username": "your-username",
"app_password_env": "WP_APP_PASSWORD"
},
"news_sources": [
{"type": "rss", "url": "https://feeds.bbci.co.uk/news/world/rss.xml", "name": "BBC World", "max_items": 5},
{"type": "newsapi", "category": "general", "api_key_env": "NEWS_API_KEY", "max_items": 5}
],
"publishing": {
"posts_per_day": 5,
"categories": ["News"],
"default_tags": ["news"],
"status": "publish",
"language": "zh"
},
"images": {
"source": "unsplash",
"api_key_env": "UNSPLASH_API_KEY",
"fallback_from_rss": true
}
}切勿在 config.json 中存储密码或 API 密钥。 所有敏感信息均从环境变量加载。
| 变量 | 用途 | 是否必需 |
|---|---|---|
WP_APP_PASSWORD | WordPress 应用密码 | 是 |
UNSPLASH_API_KEY | Unsplash 图片搜索 | 否 |
PEXELS_API_KEY | Pexels 图片搜索 | 否 |
PIXABAY_API_KEY | Pixabay 图片搜索 | 否 |
NEWS_API_KEY | NewsAPI.org 新闻头条 | 否 |
在 OpenClaw 设置中配置(~/.openclaw/openclaw.json):
{
"skills": {
"entries": {
"auto-publisher": {
"enabled": true,
"env": {
"WP_APP_PASSWORD": "xxxx xxxx xxxx xxxx"
}
}
}
}
}{baseDir}/logs/auto_publish.log| 平台 | 状态 | 认证方式 |
|---|---|---|
| WordPress | 完全支持 | 应用密码(REST API v2) |
| 自定义 REST API | 基础支持 | Bearer Token / 自定义请求头 |
用户可通过 {baseDir}/templates/ 目录中的模板自定义文章格式:
default.md — 带来源引用的标准新闻文章格式brief.md — 简短新闻摘要格式已收录 1 个 Skill