Syndication slice 4a: Hacker News + Reddit prefilled share links - #4
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: HNsubmitlink?u=&t=, Redditsubmit?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.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.blog_syndication_statusnow also returnsshare, 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 indocs/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 newSyndicatorshare-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