Repository navigation
feat(providers): read Lobste.rs stories and Lemmy posts as posts - #8
Merged
Merged
Conversation
Two more platforms a post can be read from without an account. Lobste.rs follows the Hacker News pattern (host-bound, the .json twin of each page); Lemmy follows Mastodon's (read from whichever instance hosts it) but is recognised by host — the lemmy. prefix or a short list — never by /post/<n> alone, because that is any blog's address and a shape-only match would send /api/v3 requests to sites that never invited them. Lemmy answers a missing post and a private instance with the same 400, told apart only by the body's token, so ProviderError now carries that one bare identifier (`code`) and nothing else from the body: not_logged_in is BLOCKED, couldnt_find_post is UNREACHABLE, anything else is UNAVAILABLE. Both platforms were probed without auth and read live before this commit (spec §6.2). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012cDuGjsQS1Ei8eoxDrak8Z
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.
What this changes
Two more platforms a post can be read from without an account: Lobste.rs (host-bound, the
.jsontwin of each story/comment page — the Hacker News pattern) and Lemmy (read from whichever instance hosts it — the Mastodon pattern — but recognised by host: thelemmy.prefix orlemm.ee,sh.itjust.works,beehaw.org,programming.dev,feddit.org; never by/post/<n>alone).polite.ProviderErrorgainscode, the bareerrortoken of a JSON error body (^[a-z][a-z0-9_]{1,63}$only, nothing else from the body).Why
The README's platform table was five rows. Lemmy answers a missing post and a private instance with the same
400, told apart only by the body's token (couldnt_find_postvsnot_logged_in); withoutcodethe reader would file a private instance as "not found" — the absence-as-evidence product rule 2 forbids. Nownot_logged_in→UNVERIFIED (blocked),couldnt_find_*→UNVERIFIED (unreachable), any other400→UNVERIFIED (unavailable). The host rule for Lemmy keeps/api/v3requests off blogs whose articles happen to live at/post/<n>.Read live before this PR:
lemmy.world/post/1,lemmy.world/comment/100,lobste.rs/s/htziuj(1 claim supported),lobste.rs/c/fltdzp;lemmy.world/c/technology→ "is a page, not a post";lemmy.world/post/999999999→ not found (HTTP 400). Full code review + re-review; findings resolved or recorded in OPEN-ITEMS §18.Checklist
ruff checkandruff format --checkare cleanpytestpasses🤖 Generated with Claude Code
https://claude.ai/code/session_012cDuGjsQS1Ei8eoxDrak8Z