Skip to content

feat(fetcher): add reddit public listing fetchers - #156

Merged
unhappychoice merged 7 commits into
mainfrom
feat/reddit-public-fetchers
Apr 26, 2026
Merged

unhappychoice merged 7 commits into
mainfrom
feat/reddit-public-fetchers

Conversation

@unhappychoice

@unhappychoice unhappychoice commented Apr 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add a new reddit_* fetcher family under src/fetcher/reddit/, mirroring the hackernews/ module layout (client / common / one fetcher per file)
  • ship reddit_subreddit_posts (type = top|hot|new|rising, with period for top)
  • ship reddit_user_posts and reddit_user_comments, all Safety::Safe (host fixed, names normalized to [A-Za-z0-9_-])
  • output supports LinkedTextBlock / TextBlock / Entries; falls back to a per-shape "reddit unavailable" body on transient errors

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test fetcher::reddit::

Related

Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]

@coderabbitai

coderabbitai Bot commented Apr 26, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@unhappychoice has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 44 minutes and 52 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 44 minutes and 52 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f328254f-ea6c-488a-bd10-2efd8ff6985f

📥 Commits

Reviewing files that changed from the base of the PR and between 87c88b7 and 4357206.

📒 Files selected for processing (7)
  • src/fetcher/mod.rs
  • src/fetcher/reddit/client.rs
  • src/fetcher/reddit/common.rs
  • src/fetcher/reddit/mod.rs
  • src/fetcher/reddit/subreddit_posts.rs
  • src/fetcher/reddit/user_comments.rs
  • src/fetcher/reddit/user_posts.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/reddit-public-fetchers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Ship OAuth-free reddit fetchers for subreddit posts, user submissions, and user comments with list_links-friendly output and resilient request profiles for unstable endpoint behavior.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@unhappychoice
unhappychoice force-pushed the feat/reddit-public-fetchers branch from 39a38ab to d018165 Compare April 26, 2026 08:17
@codecov

codecov Bot commented Apr 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.17800% with 128 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.46%. Comparing base (0d5ebb2) to head (4357206).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
src/fetcher/reddit/client.rs 24.65% 55 Missing ⚠️
src/fetcher/reddit/common.rs 94.02% 20 Missing ⚠️
src/fetcher/reddit/subreddit_posts.rs 83.47% 19 Missing ⚠️
src/fetcher/reddit/user_comments.rs 92.01% 19 Missing ⚠️
src/fetcher/reddit/user_posts.rs 61.53% 15 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #156      +/-   ##
==========================================
+ Coverage   78.16%   78.46%   +0.29%     
==========================================
  Files         113      121       +8     
  Lines       21378    22499    +1121     
==========================================
+ Hits        16711    17654     +943     
- Misses       4667     4845     +178     
Files with missing lines Coverage Δ
src/fetcher/mod.rs 84.23% <100.00%> (+0.26%) ⬆️
src/fetcher/reddit/mod.rs 100.00% <100.00%> (ø)
src/fetcher/reddit/user_posts.rs 61.53% <61.53%> (ø)
src/fetcher/reddit/subreddit_posts.rs 83.47% <83.47%> (ø)
src/fetcher/reddit/user_comments.rs 92.01% <92.01%> (ø)
src/fetcher/reddit/common.rs 94.02% <94.02%> (ø)
src/fetcher/reddit/client.rs 24.65% <24.65%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

unhappychoice and others added 6 commits April 26, 2026 17:27
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Mirrors the hackernews/ layout: shared client/listing in client.rs, shared
post DTO + rendering in common.rs, one fetcher per file. Drops the
single-URL fetch_listing_with_bases abstraction and widens Post.score to
i64 so heavily-downvoted posts deserialize cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Adds tests for the parts that were previously untested or thin:
render_posts across all three shapes (with empty input, missing fields,
permalink fallback), Post / Comment deserialization against realistic
Reddit envelopes, listing path generation (only `t=` for top), the
comment_link composer, sample_*_body shape matrix, multi-byte truncate,
and Options::default for each fetcher.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@unhappychoice
unhappychoice merged commit ebeca02 into main Apr 26, 2026
7 checks passed
@unhappychoice
unhappychoice deleted the feat/reddit-public-fetchers branch April 26, 2026 09:59
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.

feat(templates): add home_feed preset — morning briefing (HN / today / read-more)

1 participant