Skip to content

fix(posts): restore public listing with cursor pagination - #21

Merged
jiro-by-nori[bot] merged 3 commits into
mainfrom
fix/post-list-pagination
Nov 13, 2026
Merged

jiro-by-nori[bot] merged 3 commits into
mainfrom
fix/post-list-pagination

Conversation

@jiro-by-nori

@jiro-by-nori jiro-by-nori Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Substack now rejects every offset parameter and returns {posts, nextCursor} from public post listings. This broke the dashboard's scheduled ingest. Normalize the page into the existing data array, expose pagination.nextCursor, and add --cursor; accept but omit offset zero and reject unsupported nonzero offsets locally with cursor guidance. Malformed listings fail instead of looking like an empty feed.

Built on f5bf87f, retaining the unmerged PR #20 trailing-slash fix. Do not merge without Amol's approval. The dashboard will pin this branch's commit.

Validation: 74 tests pass, TypeScript compile and ESLint pass. Read-only live CLI request returns post 223828762 plus an upstream cursor; HTTP tests cover cursor continuation, zero-offset compatibility, legacy arrays, and malformed responses. Compiled distribution included for Git installs.

🤖 Generated with Nori: https://noriagentic.com/

… a comment on request

Notes that restack a Note or post carry restacked {kind,id,author,title?,text,url}
(capability note-restacked-item). --include-restacks reads the full profile feed and
exports other authors' Notes and posts restacked without a comment as restack-c-<id> /
restack-p-<id> (capability note-restacks). Default output is unchanged apart from the
added field.

🤖 Generated with [Nori](https://noriagentic.com/)

Co-Authored-By: Nori <contact@tilework.tech>
@jiro-by-nori

jiro-by-nori Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Verified HEAD 6b974f8:

  • TypeScript compile and ESLint passed; full suite: 74/74 tests.
  • CI passed on Node 18 and Node 22.
  • Read-only live CLI first-page call (post list --publication-url https://12gramsofcarbon.com --limit 2 --offset 0) succeeded and returned IDs 223858849, 223828762 as data plus pagination.nextCursor.
  • The dashboard adapter consumed that cursor and fetched IDs 222871981, 221580283 on the next page.
  • Actual post export succeeded for 223828762: matching title/canonical URL, 7,388 HTML characters, 8 images.

No content was published or sent. PR remains open pending Amol’s merge approval.

@jiro-by-nori
jiro-by-nori Bot merged commit 53c5a51 into main Nov 13, 2026
4 checks passed
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