360 Secure SkillHub
360 安全技能中心

Tweet Pipeline

该 Skill 从 Notion 内容日历读取状态为 Approved 的推文,为未来时间点创建一次性 cron 定时任务,到点后通过 X/Twitter OAuth2 API 发布并回写发布状态,支持 --dry-run 预览。脚本中出现宿主专属的 Python 与 Node 绝对路径,并通过 openclaw 添加 cron。

nissan
nissan
热度 70.13
最近更新 2026-05-18 12:16:20
分类:营销依赖:代码执行 / 第三方 API / 读写文件应用场景:社交媒体 / 自动化脚本 / 日程安排 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add tweet-pipeline
Metadata
name
tweet-pipeline
version
1.0.0
description
Notion-to-Twitter automation — pull approved tweets from a Notion database, schedule one-shot crons for exact post times, and post via X/Twitter OAuth2 API. Use when managing a content calendar in Notion and want automated, precisely-timed tweet posting.
metadata
{"openclaw":{"emoji":"🐦","requires":{"bins":["python3"],"env":["NOTION_API_KEY"]},"primaryEnv":"NOTION_API_KEY","network":{"outbound":true,"reason":"Reads from Notion API (api.notion.com) for tweet queue. Posts to X/Twitter API (api.x.com) via OAuth2."}}}

Tweet Pipeline

Automate tweet posting from a Notion content calendar. Draft tweets in Notion, set status to "Approved" with a scheduled time, and this pipeline handles the rest.

Workflow

Notion DB (Tweet Pipeline)
  ├── Status: Pending → Agent drafts tweet
  ├── Status: Approved → Heartbeat picks up
  │     ├── Future time → Schedules one-shot cron
  │     └── Past due → Posts immediately
  └── Status: Posted → Done (updated by poster)

Notion DB Schema

Property Type Values
Title title Tweet text
Status select Pending, Approved, Posted, Failed
Scheduled date ISO datetime with timezone
Platform select Twitter, LinkedIn
Posted At date Filled after posting

Usage

python3 scripts/tweet_poster.py             # Check and schedule
python3 scripts/tweet_poster.py --dry-run   # Preview without scheduling

Key Lessons

  • One-shot crons for exact times — don't batch-post from heartbeat, schedule each tweet individually
  • X Free tier: 1,500 tweets/month, 280 char limit, no media upload via API
  • Track scheduled tweets in a state file to avoid duplicate scheduling

Files

  • scripts/tweet_poster.py — Scheduler (reads Notion, creates crons)
  • scripts/tweet_post_one.py — Poster (called by each cron job)