← Back to Creation of Digital Den

Part 14: Teaching the Site to Post for Itself

By Ed CoyeOctober 10, 2026

Every day, Digital Den drafts a new article, I review it and I publish it. Then I'd go share it on Facebook by hand. On October 10 I decided the site should handle that last step itself.

Rent it or build it?

A service like Metricool could have had me posting in about fifteen minutes. Building it myself would take an afternoon or more. I chose to build. The idea had been on my list since October 1, most of the pieces already existed, and I'd rather own the system than pay a monthly fee for it. Claude's first question was a good one: is Digital Den on Facebook as a Page or a personal profile? Facebook only lets programs post to Pages.

The token chase

The hardest part wasn't code. To post to a Page, a program needs a Page access token, a long password that proves it's allowed. Meta's tools hand out several kinds of tokens, some lasting an hour and some never expiring, and they look almost identical. In Meta's Graph API Explorer, picking my Page from a dropdown quietly swapped my long-lasting token for a short-lived one.

It took several rounds to find the order that works: create and extend a user token first, then ask Facebook for the Page token directly, without touching the dropdowns. The result never expires. I pasted it into Supabase's secret settings myself. Claude walked me through every screen but never handled the credential.

Small steps, tested one at a time

We built it in layers. First came a queue table in Supabase: a list of posts waiting to go out, with a log of what happened to each one. Then Claude Code built a small cloud program, called an Edge Function, that posts whatever is in the queue. I started it by hand and watched the first test post appear on the Page. Only after that worked did we connect Sanity. Now, when I publish an article, Sanity sends a notification called a webhook, and the post goes out within seconds.

The content decisions were mine. Articles only for now, so we don't flood anyone's feed. A photo post using the article's cover image, rather than a plain link. And every post ends with the same line: "Got a tech question of your own? Read the full article and join our community at digitalden.com."

How do you retry when you don't know if it worked?

This was the most interesting question of the day. If Facebook clearly says no, trying again later is safe. But if the call simply times out, the post may have gone through anyway, and a retry could post it twice.

So the system treats those cases differently. Clear errors from Facebook get up to three tries, half an hour apart. Timeouts, and any post stuck mid-send for more than ten minutes, are marked "needs check" and wait for me. A scheduler runs every 15 minutes to pick up retries and articles dated for the future, much like a batch job on a timer. Whenever something needs attention, an email lands in my inbox. We tested the failure path on purpose, and the alert arrived.

Claude Code also locked the posting program so only the system itself can start it, not just anyone who finds its address.

Brand names aren't job titles

At one point Claude Code asked me for a Resend key, and I was lost. I'd forgotten we were already using Resend to send the site's emails. Digital Den now involves six companies, and their names say nothing about what they do. So Claude made me a cheat sheet: Sanity is the editor, Supabase the back office, Netlify the storefront, Resend the mailroom, Facebook the bulletin board and GoDaddy the street address. I keep it close.

The lesson

Before you automate something, decide what should happen when it fails, especially when you can't tell whether it worked. Retrying blindly is how one post becomes two.

Try it yourself

Next time you ask an AI to automate a task, ask it: "What happens if this fails halfway through, and how will I find out?" If the answer is vague, the design isn't finished.

Instagram may be next, since it can reuse most of this setup. Follow the project to catch the next entry.

Discussion

No comments yet — be the first to say something.