← 返回
安全合规 中文

soulmd-newsletter

Fetches and displays the latest edition from the SoulMD newsletter RSS feed, including title, date, link, and a brief excerpt.
获取并展示 SoulMD 新闻通讯 RSS 提要的最新内容,包含标题、日期、链接及简要摘要。
meastt
安全合规 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 469
下载
💾 4
安装
1
版本
#agents#daily#latest#news#newsletter#openclaw#security

概述

#!/usr/bin/env python3

import sys, json, urllib.request, xml.etree.ElementTree as ET, re

from datetime import datetime

from pathlib import Path

RSS_URL = "https://buttondown.com/soulmd/rss"

SUBSCRIBE_URL = "https://buttondown.com/soulmd"

STATE_FILE = Path.home() / ".openclaw" / "soul-md-state.json"

def fetch_rss():

req = urllib.request.Request(RSS_URL, headers={"User-Agent": "soul-md-skill/1.0"})

with urllib.request.urlopen(req, timeout=10) as resp:

return resp.read()

def parse_latest(xml_bytes):

root = ET.fromstring(xml_bytes)

item = root.find("channel/item")

if item is None:

return None

plain = re.sub(r"<[^>]+>", "", item.findtext("description", ""))[:600].strip()

return {"title": item.findtext("title","").strip(), "link": item.findtext("link","").strip(), "date": item.findtext("pubDate","").strip(), "excerpt": plain}

def load_state():

return json.loads(STATE_FILE.read_text()) if STATE_FILE.exists() else {}

def save_state(state):

STATE_FILE.parent.mkdir(parents=True, exist_ok=True)

STATE_FILE.write_text(json.dumps(state))

def main():

check_new = "--check-new" in sys.argv

try:

latest = parse_latest(fetch_rss())

except Exception as e:

print(f"Error: {e}", file=sys.stderr); sys.exit(1)

if not latest:

print("No editions found."); sys.exit(0)

if check_new:

state = load_state()

if latest["link"] == state.get("last_seen_link",""):

print("NO_NEW_EDITION"); sys.exit(0)

save_state({"last_seen_link": latest["link"], "last_checked": datetime.utcnow().isoformat()})

print(f"TITLE: {latest['title']}\nDATE: {latest['date']}\nLINK: {latest['link']}\nSUBSCRIBE: {SUBSCRIBE_URL}\n\nEXCERPT:\n{latest['excerpt']}")

if __name__ == "__main__":

main()

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 05:41 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 89 📥 30,605
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,215 📥 266,467
security-compliance

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,714