DEV Community

Cover image for Your publishing script needs a ledger before it needs another AI call
Daniil Kornilov
Daniil Kornilov

Posted on

Your publishing script needs a ledger before it needs another AI call

The expensive part of cross-posting should be preparing a useful article. Uploading it should be a predictable operation.

Keep a manifest with the platform, account, title, Markdown file, cover and status. After a successful create request, save the returned post ID and URL before processing the next item.

The awkward case is a timeout after the platform accepted your request. Retrying blindly can publish the same article twice. Mark the item as uncertain, check the account for the title or returned ID, then decide whether a retry is needed. A timeout is different from a confirmed rejection.

Respect the platform's rate limit. When it tells you to wait, stop that batch and keep the remaining items in the manifest. Rewriting the same post or switching accounts to push through a limit does not make delivery reliable.

Keep formatting separate from content: Markdown for a developer blog, a short caption for a channel, and platform-specific cover uploads. A single source can support several versions without forcing identical posts everywhere.

You can run this workflow with ordinary files and a small script. Bring a model back in when the content needs judgment, a source needs checking or an unexpected response needs diagnosis.


Disclosure: This article was prepared with AI assistance and reviewed against the linked sources and implementation. Examples explicitly marked fictional are illustrative.

Top comments (0)