hacker-news
github.com/include-tools/hacker-news · typescript-sandbox · v0.2.0
Install
toolbox install github.com/include-tools/hacker-news@v0.2.0Tools (9)
comments.searchread onlySearch Hacker News comments through the public Algolia HN Search API. The tool supports full-text queries plus documented author, story-id, and created_at filters while keeping returned hits bounded.
items.getread onlyitems.recentread onlyDiscover the newest items on Hacker News of any type by reading `maxitem` and walking ids downward, hydrating up to `limit` live ones. A `scan_budget` of `max(3, 2 * limit)` bounds the walk so a run of dead/deleted ids cannot scan forever while still allowing a single-item request to skip two dead ids. `items_returned < limit` means the budget was exhausted before `limit` live items were found. `truncated` is always true (older items always exist below).
stories.listread onlyList a ranked Hacker News feed (front page or category) as bounded story summaries, hydrating each selected id into a lean record. Summaries omit `text`/linkage to stay bounded — use items.get for an Ask HN body. The `top` and `job` feeds legitimately mix in job posts (tagged via `type`).
stories.searchread onlySearch Hacker News stories through the public Algolia HN Search API. Results can be sorted by relevance or newest-first date and filtered with documented story tags, author tags, and numeric created_at/points/comment filters.
threads.getread onlyReconstruct the discussion under an item as a bounded nested comment tree: fetch the root, then walk its `kids` breadth-first within a depth and node budget. Returns a bounded sample, not the whole tree — `truncated` flags when the walk stopped with kids still unexpanded. Deleted/dead comments are skipped and their subtree pruned.
updates.getread onlyReturn Hacker News's change feed — recently changed item ids and usernames — in one cheap pass-through read for polling loops. Does not hydrate and does not advance any cursor or consume events; arrays are relayed in upstream order up to fixed caps (the agent slices further client-side before hydrating).
users.getread onlyResolve a Hacker News user profile by (case-sensitive) username and, optionally, hydrate a bounded sample from their `submitted` ids into items. The full `submitted` list (potentially thousands of ids) is never returned — only its length (`submitted_count`) and up to `include_recent` hydrated records.
users.searchread only