Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/blog-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ jobs:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
MICROBLOG_APP_TOKEN: ${{ secrets.MICROBLOG_APP_TOKEN }}
MICROBLOG_DESTINATION_UID: ${{ vars.MICROBLOG_DESTINATION_UID }}
# Comma-separated UIDs from GET /micropub?q=syndicate-to (linkedin, mastodon, bluesky, threads).
# Defaults to 'linkedin' if the repo variable is unset.
MICROBLOG_SYNDICATE_TO: ${{ vars.MICROBLOG_SYNDICATE_TO || 'linkedin' }}
POST_PATH: ${{ steps.post.outputs.path }}
BASE_URL: https://doughatcher.com
run: node apps/editorial-loop/publish.js
Expand Down
11 changes: 11 additions & 0 deletions apps/editorial-loop/lib/microblog-poster.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ export async function postToMicroblog(text) {
if (process.env.MICROBLOG_DESTINATION_UID) {
params.append('mp-destination', process.env.MICROBLOG_DESTINATION_UID);
}
// micro.blog requires per-post opt-in for syndication — it does NOT honor
// the account-level cross-post default for API-posted entries. Pass each
// destination UID as a separate mp-syndicate-to[] form field.
// Discover UIDs at GET /micropub?q=syndicate-to (e.g. "linkedin", "mastodon").
const syndicateTo = (process.env.MICROBLOG_SYNDICATE_TO || '')
.split(',')
.map(s => s.trim())
.filter(Boolean);
for (const uid of syndicateTo) {
params.append('mp-syndicate-to[]', uid);
}

const res = await fetch('https://micro.blog/micropub', {
method: 'POST',
Expand Down
Loading