Why I dropped the X API for an IFTTT webhook - and what it cost me
说明与用途
作者将 X API 换成 IFTTT Webhook 以避免 OAuth,但发现 200 响应仅表示接受而非发布。通过提取错误信息、区分 accepted 与 published 状态,并通过公开时间线验证发布,解决了问题。同时修复了 launchd 的 PATH 和睡眠行为。
问题
The author’s bot failed to reliably confirm that tweets were posted when using an IFTTT webhook, because the webhook’s 200 response only indicated acceptance, not publication, leading to a false sense of success.
结果
The bot now accurately reports posting success, avoids false positives, and handles launchd quirks, resulting in reliable tweet announcements.
工作流
- Generate announcement text and enqueue with scheduledAt timestamps
- Launchd job runs every 30 minutes, sending queued items via IFTTT webhook
- Extract errors from IFTTT response body to detect failures
- Treat "published" as null (unknown) and log only "accepted"
- Verify actual posts by scraping the public X timeline
证据
IFTTT can return an error in the body while the status stays 200
Treat "published" as null (unknown)
Setting PATH explicitly in EnvironmentVariables fixed node: command not found
- 记录日期: 2026-09-16T10:15:32.673Z