The author manages an automated posting system for Telegram, Threads, X, Bluesky, and YouTube Shorts on a single VPS. The architecture relies on Python, JSON files for data storage, and systemd timers for scheduling tasks. The system processes RSS feeds and Telegram content, generating drafts via Claude Sonnet.
A bug in the Threads integration caused duplicate posts when the API returned error 4279047. The system attempted to retry the entire chain of posts, including the parent, after a failure in a reply. The fix involves implementing a retry mechanism with increasing delays for replies and establishing a point of no return after the initial post is published.
Another issue involved inaccurate daily reporting of published posts. The regex-based log parser failed to recognize new content slots added to the system. The author updated the regular expression to capture all published entries and added a dedicated test to ensure metric accuracy. A third bug caused double-counting of API costs due to redundant logging in the request wrapper.
The system operates under a daily budget of $1.80 for AI models, with a cap of $0.40 per post. The author notes that API costs for reading X are significant, necessitating infrequent data polling. Future development plans emphasize logging every action, ensuring idempotency before publication, and centralizing financial tracking.





