返回顶部
a

auto-sec-blogger自动安全博客

AI-powered security blog automation system (identical to github.com/rebugui/intelligence-agent). Collects news from Google News, arXiv, HackerNews → generates blog posts with GLM-4.7 → publishes to Notion → auto-deploys to GitHub Pages via Git. Features Human-in-the-Loop approval workflow. Use when you want to automate blog writing, news collection, or content generation with the exact functionality of the original intelligence-agent repository. Triggers: "블로그 글 작성", "보안 뉴스 발행", "깃헙 블로그 발행", "in

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

auto-sec-blogger

智能代理

概述

这是一个自动收集安全新闻,使用LLM(GLM-4.7)撰写专家级博客文章,并自动发布到Notion和GitHub Pages的系统。

GitHub仓库地址: https://github.com/rebugui/intelligence-agent

架构

新闻收集 (Google News, arXiv, HackerNews)

GLM-4.7 文章撰写 (专业安全博客)

Notion 草稿保存 (状态: Draft)

用户审核与批准 (Human-in-the-Loop)

Git Push → GitHub Actions → GitHub Pages

主要功能

1. 新闻收集 (News Collection)

  • - Google News: 基于关键词的安全新闻收集
  • arXiv: 最新安全研究论文收集
  • HackerNews: 热门技术新闻收集
  • 去重: 基于URL的重复新闻过滤

2. LLM写作 (Content Generation)

  • - 模型: GLM-4.7 (智谱AI)
  • 风格: 专业安全博客
  • 结构:
- 标题 (头条) - 摘要 (3行摘要) - 正文 (详细分析) - 结论 (启示) - 标签 (关键词)
  • - Mermaid图表: 攻击流程、架构可视化

3. Notion集成 (Notion Integration)

  • - 状态管理: Draft → Review → Approved → Published
  • 自动保存: 生成的文章自动保存
  • 用户批准: 在Notion中通过状态变更进行发布批准

4. 基于Git的发布 (Git Publishing)

  • - 自动提交: 将Markdown文件提交到Git
  • GitHub Actions: 自动Jekyll构建
  • GitHub Pages: 静态博客部署

安装

1. 安装依赖

bash
cd ~/.openclaw/workspace/skills/intelligence-agent/scripts
pip3 install -r requirements.txt

2. 环境变量设置

bash

~/.openclaw/workspace/.env

GLM API

GLMAPIKEY=yourglmapi_key GLMBASEURL=https://api.z.ai/api/coding/paas/v4

Notion

NOTIONAPIKEY=ntn_xxx NOTIONDATABASEID=xxx

GitHub Pages

GITHUBTOKEN=ghpxxx GITHUBBLOGREPO=username/username.github.io BLOGLOCALPATH=/path/to/blog/repo

使用方法

1. 运行完整流水线 (测试用)

bash
cd ~/.openclaw/workspace/skills/intelligence-agent/scripts
python3 intelligence_pipeline.py --max-articles 5

2. 仅收集新闻

python
from collector import NewsCollector

collector = NewsCollector()
articles = collector.fetchall(maxresultspersource=15)

3. 仅撰写博客文章

python
from writer import BlogWriter

writer = BlogWriter()
post = writer.generatearticle(articledata)

4. 仅发布到Notion

python
from notion_publisher import NotionPublisher

publisher = NotionPublisher()
result = publisher.createarticle(blogpost)

5. 仅发布到Git

python
from gitpublisherservice import GitPublisherService

git_publisher = GitPublisherService()
gitpublisher.publish(blogposts)

工作流详情

第1步: 新闻收集

python

collector.py


class NewsCollector:
def fetchgooglenews(self, query=security vulnerability):
# 从Google News RSS源收集
pass

def fetch_arxiv(self, category=cs.CR):
# 收集arXiv安全论文
pass

def fetch_hackernews(self):
# 收集HackerNews热门文章
pass

第2步: AI文章筛选

python

selector.py


class ArticleSelector:
async def evaluateandselect(self, articles, max_articles=5):
# 使用GLM-4.7评估文章质量
# 基于分数筛选优质文章
pass

第3步: 撰写博客文章

python

writer.py


class BlogWriter:
async def generate_article(self, article):
# 使用GLM-4.7撰写博客文章
# 生成Mermaid图表
# 输出Markdown格式
pass

第4步: 发布到Notion

python

notion_publisher.py


class NotionPublisher:
def createarticle(self, blogpost):
# 以Draft状态保存到Notion数据库
# 状态: Draft → Review → Approved
pass

第5步: 发布到Git (用户批准后)

python

gitpublisherservice.py


class GitPublisherService:
def publish(self, blog_posts):
# 生成Markdown文件
# Git commit & push
# 触发GitHub Actions
pass

Cron调度

每天08:30自动执行

python

intelligence_pipeline.py


from apscheduler.schedulers.blocking import BlockingScheduler

scheduler = BlockingScheduler()
scheduler.addjob(runpipeline, cron, hour=8, minute=30)
scheduler.start()

Notion数据库结构

必需属性

属性名类型描述
标题title博客文章标题
状态
select | Draft/Review/Approved/Published | | 日期 | date | 发布日期 | | 标签 | multi_select | 关键词 | | URL | url | 原文URL | | 分类 | select | 漏洞/研究/趋势 |

Jekyll博客结构

blog/
├── _posts/
│ ├── 2025-03-09-cve-2025-xxxx-analysis.md
│ ├── 2025-03-09-ai-security-trends.md
│ └── ...
├── _layouts/
│ ├── post.html
│ └── default.html
├── _config.yml
└── .github/
└── workflows/
└── jekyll.yml

故障排除

GLM API速率限制

❌ Error: Rate limit reached (429)

解决方案:

  • - 自动重试3次
  • 等待60秒后重试

Notion API错误

❌ Error: Notion API error

解决方案:

  • - 检查API密钥
  • 检查数据库ID
  • 检查集成权限

Git推送失败

❌ Error: Git push failed

解决方案:

  • - 检查GitHub Token
  • 检查远程仓库权限
  • 检查分支

文件结构

intelligence-agent/
├── SKILL.md (本文件)
├── scripts/
│ ├── intelligence_pipeline.py (主流水线)
│ ├── collector.py (新闻收集)
│ ├── selector.py (AI文章筛选)
│ ├── writer.py (博客文章撰写)
│ ├── notion_publisher.py (Notion发布)
│ ├── gitpublisherservice.py (Git发布)
│ ├── llm_client.py (GLM API客户端)
│ ├── llmclientasync.py (异步GLM客户端)
│ ├── prompt_manager.py (提示词管理)
│ ├── prompts.yaml (提示词模板)
│ ├── models.py (数据模型)
│ ├── utils.py (工具函数)
│ ├── config.py (配置)
│ └── requirements.txt (依赖)
└── references/
├── architecture.md (详细架构)
├── prompts_guide.md (提示词指南)
└── api_reference.md (API参考)

环境变量

必需

bash
GLMAPIKEY # GLM-4.7 API密钥
NOTIONAPIKEY # Notion API密钥
NOTIONDATABASEID # Notion数据库ID

可选

bash
GITHUB_TOKEN # GitHub个人访问令牌
GITHUBBLOGREPO # GitHub博客仓库 (username/repo)
BLOGLOCALPATH # 本地博客路径

测试

完整流水线测试

bash
python3 testfullpipeline.py

Mermaid图表测试

bash
python3 testmermaidfix.py

参考资料

资源

scripts/

包含原始仓库的所有Python脚本:
  • - intelligence_pipeline.py - 完整流水线执行
  • collector.py

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 auto-sec-blogger-1776179464 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 auto-sec-blogger-1776179464 技能

通过命令行安装

skillhub install auto-sec-blogger-1776179464

下载

⬇ 下载 auto-sec-blogger v1.0.1(免费)

文件大小: 60.57 KB | 发布时间: 2026-4-15 10:29

v1.0.1 最新 2026-4-15 10:29
auto-sec-blogger 1.1.0 introduces auto-publishing for Notion-approved posts.

- Added scripts/auto_publish_approved.py to enable automatic publishing of blog posts after Notion approval.
- Updated SKILL.md with new version and enhancements.
- Improved configuration in scripts/config.py.
- Enhanced publishing workflow in scripts/publish_github.py and scripts/run_pipeline.py.

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

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

p2p_official_large
返回顶部