Skip to content

Syndication slice 4a: Hacker News + Reddit prefilled share links - #4

Merged
DanMat merged 1 commit into
mainfrom
feat/syndication-slice-4-sharelinks
Sep 7, 2026
Merged

DanMat merged 1 commit into
mainfrom
feat/syndication-slice-4-sharelinks

Conversation

@DanMat

@DanMat DanMat commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

The aggregator half of syndication. Hacker News and Reddit are link-submission communities, not blogs, so the honest mechanism isn't an API push — it's a prefilled submit link the human clicks, which is what this adds.

What's here

  • ShareLinks::for(title, url) — pure builder for the two prefilled URLs: HN submitlink?u=&t=, Reddit submit?url=&title=, both percent-encoded.
  • Syndicator::shareLinks(slug) — points them at the post's true canonical (declared original if the post is itself a copy, else self /blog/{slug}), matching the aggregator norm of not submitting a syndicated duplicate. Empty for a missing post.
  • Admin — a Share column on the Syndication page (links open in a new tab, rel="noopener nofollow"), plus a footnote spelling out Share vs auto-post and the expected HN behaviour: a re-submit of an already-posted URL opens the existing thread, not a duplicate.
  • MCPblog_syndication_status now also returns share, so an agent can hand a human the prefilled links (an agent can't click, but it can surface them).

Deliberately not here

No credential, no stored state, no outbound call — nothing touches blog_syndication (there's no external id to track for a link the human submits). Reddit API auto-submit stays out of scope: it's OAuth + forced-subreddit + spam-filter territory, only ever an opt-in single-user mode — the conversation for that lives in docs/DESIGN-syndication.md. HN has no submit API at all, so a link is the only option there regardless.

Tests

ShareLinksTest (both URLs + encoding) and new Syndicator share-link tests (self vs declared canonical, empty for a missing post). Local: phpstan level 6 clean, cs-fixer clean, phpunit green (MySQL repository suite runs in CI).

This makes syndication complete end to end — Dev.to + Hashnode auto-post, HN + Reddit share — across both the admin and MCP.
🤖 Generated with Claude Code

Adds the aggregator half of syndication: HN and Reddit are link-submission
communities, not auto-post targets, so instead of an API push they get a
prefilled submit link the human clicks. `ShareLinks::for(title, url)` builds
the two URLs (HN submitlink u/t, Reddit submit url/title, both encoded);
`Syndicator::shareLinks(slug)` points them at the post's true canonical
(declared original if any, else self), matching aggregator etiquette.

Surfaces, same as the auto-post targets:
- Admin: a "Share" column on the Syndication page, links open in a new tab
  (rel="noopener nofollow"), plus a footnote explaining Share vs auto-post
  and the expected HN "opens the existing thread" behaviour on a re-submit.
- MCP: `blog_syndication_status` now also returns `share`, so an agent can
  hand a human the prefilled links.

No credential, no stored state, no outbound call — nothing touches
`blog_syndication`, since there is no external id to track for a link the
human submits. README documents the Share column.

Reddit API auto-submit stays out of scope (opt-in, single-user,
spam/OAuth caveats in docs/DESIGN-syndication.md).

Tests: ShareLinksTest (both URLs + encoding); Syndicator share-link tests
(self vs declared canonical, empty for a missing post).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DanMat
DanMat merged commit b36148b into main Sep 7, 2026
2 checks passed
@DanMat
DanMat deleted the feat/syndication-slice-4-sharelinks branch September 7, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant