Skip to content

Fix Reddit popular HTML response handling#17

Open
ankitranjan7 wants to merge 1 commit into
mainfrom
fix-reddit-popular-html-json
Open

Fix Reddit popular HTML response handling#17
ankitranjan7 wants to merge 1 commit into
mainfrom
fix-reddit-popular-html-json

Conversation

@ankitranjan7

Copy link
Copy Markdown

Summary

  • Make reddit popular explicitly navigate to https://www.reddit.com before fetching /r/popular.json
  • Guard Reddit JSON parsing so HTML/interstitial responses produce a useful adapter error instead of raw Unexpected token <
  • Update the Reddit popular adapter test to cover navigation and guarded parsing

Verification

  • npm run test:adapter -- clis/reddit/popular.test.js
  • npm run dev -- reddit popular --limit 3 -f json
  • npm run test:adapter -- clis/reddit/*.test.js
  • npm run check:typed-error-lint
  • npm run check:silent-column-drop
  • npm run typecheck
  • npm run build

Reddit smoke checks

Read-only live commands verified:

  • reddit popular --limit 2
  • reddit frontpage --limit 2
  • reddit hot --limit 2
  • reddit subreddit programming --limit 2
  • reddit search "web development" --limit 2
  • reddit subreddit-info programming
  • reddit user spez
  • reddit user-posts spez --limit 2
  • reddit user-comments spez --limit 2
  • reddit read 1um1euf --limit 2

Auth-bound commands were not live-verified because the browser session is not logged in. Write commands were help-checked only to avoid mutating a real Reddit account.

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