reddit-fetch
하는 일
이 스킬은 Reddit이 자동화된 접근을 자주 막기 때문에, 브라우저 세션을 사용해 Reddit의 내용을 가져옵니다. 주제에 대해 Reddit에서 논의되는 내용을 조사하는 사람들을 위한 것입니다.
사용하는 경우
- ✓연구를 위해 에이전트가 Reddit 스레드나 서브레딧을 읽기를 원할 때.
- ✓Reddit 링크가 차단되거나 403 오류를 반환할 때.
- ✓제품이나 주제에 대해 Reddit 사용자들이 무엇을 생각하는지 알고 싶은 경우.
스킬 링크
https://github.com/ykdojo/claude-code-tips/blob/main/skills/reddit-fetch/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 Reddit 스레드를 읽고, 사람들이 새 노트북에 대해 어떻게 생각하는지 알려 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 먼저 검색 엔진 리디렉션을 통해 Reddit에 접근합니다. 이렇게 하면 브라우저 세션이 Reddit의 데이터를 로드할 수 있습니다. 그다음 그 데이터에서 게시물과 댓글을 읽습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Reddit Fetch
Reddit's public JSON API works by appending .json to any Reddit URL — but Reddit now hard-blocks automated access. curl 403s essentially every time (host AND container, regardless of User-Agent), and even a cold Playwright navigation to reddit.com hits a "You've been blocked by network security" challenge page. The reliable method is to arrive at Reddit through a DuckDuckGo result redirect: that sets a Reddit session cookie which unlocks direct .json access for the rest of the browser session.
Primary method: the DuckDuckGo-hop unlock
Step 1 - the DDG hop. Do this once per session before any .json fetch.
mcp__playwright__browser_navigatetohttps://html.duckduckgo.com/html/?q=site:reddit.com/r/SUBREDDIT+YOUR+QUERY- Grab the first result's full href - it's a DDG redirect that includes a
ruttoken (https://duckduckgo.com/l/?uddg=...&rut=...). The token is required; navigating to the bare/l/?uddg=without it 400s.() => document.querySelector('.result__a')?.href browser_navigateto that full redirect href. It lands on a realwww.reddit.compage (title = the post/subreddit title, not "Blocked") and sets the session cookie. The result doesn't have to be the exact thread you want - landing on any real Reddit page sets the cookie.
If Playwright errors with Browser is already in use, a stale instance is holding the profile - pkill -f ms-playwright-mcp (or the profile dir named in the error) and retry.
Step 2 - direct .json now works. For the rest of the session, navigate Playwright straight to any .json URL and JSON.parse(document.body.innerText). Use www.reddit.com (not old.reddit.com) for browser navigation. Full recency sorting (sort=new&t=week) is available.
browser_navigateto e.g.https://www.reddit.com/r/SUBREDDIT/search.json?q=QUERY&restrict_sr=on&sort=new&t=week&limit=25browser_evaluate, always wrapped in try/catch (returndocument.body.innerText.slice(0,200)on failure so you can see a challenge page if the session lapsed - just re-do the hop):() => { try { const data = JSON.parse(document.body.innerText); return data.data.children.map(c => ({ t: c.data.title, s: c.data.score, n: c.data.num_comments, id: c.data.id })); } catch (e) { return document.body.innerText.slice(0, 200); } }- For a thread, navigate to
.../comments/POST_ID.json?limit=30&sort=topand parsedata[0](post) anddata[1].data.children(comments).
JSON shapes (same for browser and curl)
# Listing - swap hot for new/top/rising; for top add &t=day|week|month|year|all
/r/SUBREDDIT/hot.json?limit=15
# Post + comments - JSON array where [0]=post, [1]=comment tree
/r/SUBREDDIT/comments/POST_ID.json?limit=20
# Search within a subreddit
/r/SUBREDDIT/search.json?q=QUERY&restrict_sr=on&sort=new&limit=15
- Listings:
.data.children[].datahastitle,score,num_comments,author,id. - Threads:
[0].data.children[0].datais the post;[1].data.children[](filterkind == "t1") are comments withauthor,score,body, and nestedrepliesof the same shape. - Truncate long comment bodies (e.g.
body.slice(0, 300)in JS,.body[:300]in jq 1.7+) to keep output readable.
Fallbacks
- More comments per thread: load the rendered thread page (after the hop) and scrape the
shredditDOM - it returns more comments than.json?limit=:() => ({ title: document.querySelector('shreddit-post')?.getAttribute('post-title'), comments: [...document.querySelectorAll('shreddit-comment')].map(c => ({ author: c.getAttribute('author'), score: c.getAttribute('score'), text: c.querySelector('.md')?.innerText })) }) - No Playwright at all: use Claude for Chrome to open the thread /
.jsonURL and read it off the page. - curl (last resort, expect 403): direct curl with a browser User-Agent used to work and is faster when it does, but it now gets 403'd essentially always - changing the UA doesn't help. Only worth a single quick try if you're already shelling out and a browser isn't available; on 403, go straight to the DDG hop.
UA="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" curl -s -L -o /tmp/reddit_result.txt -w "%{http_code}" -H "User-Agent: $UA" \ 'https://old.reddit.com/r/SUBREDDIT/hot.jso
자주 묻는 질문
검색 엔진 단계가 왜 필요한가요?
Reddit은 직접 자동 접근을 막으므로, 검색 결과를 통해 들어가야 브라우저 세션이 데이터를 로드할 수 있습니다.
어떤 도구를 쓰나요?
Playwright 브라우저를 사용해 Reddit 페이지와 데이터를 로드합니다.
항상 작동하나요?
항상은 아닙니다. Reddit의 차단 규칙이 바뀌기 때문에 이 방법이 매번 작동하지는 않을 수 있습니다.
상세 정보
작성자의 원본 설명
Fetch content from Reddit via its JSON API using a browser session (DuckDuckGo-hop unlock). Use when accessing Reddit URLs, researching topics on Reddit, or when Reddit returns 403/blocked errors.
repo: ykdojo/claude-code-tips
인기도
- GitHub 스타
- 10k
- 순위
- #11904
- 라이선스
- —
- 업데이트
- 2026. 9. 25.
댓글
- …
이 저장소의 다른 스킬
gha
10k에이전트가 GitHub Actions 워크플로가 실패한 이유와 같은 작업이 계속 실패하는지 알아보도록 돕습니다.
half-clone
10k에이전트가 긴 채팅의 뒤쪽 절반을 새 세션으로 복사해, 최근 작업은 남기고 토큰 사용을 줄이도록 돕습니다.
handoff
10k에이전트가 새 채팅이 목표, 진행 상황, 다음 단계를 분명히 이어받을 수 있도록 인수인계 문서를 쓰도록 돕습니다.
hn-summarize
10k에이전트가 공식 Hacker News 데이터를 사용해 상위 뉴스 또는 한 기사와 그 댓글을 요약하도록 돕습니다.
비슷한 스킬
graincrawl
394k에이전트가 저장된 Granola 회의 메모와 기록을 검색하고, 최신 상태를 확인하며, 일정 기간 동안 개수를 세도록 돕습니다.
notcrawl
394k에이전트가 저장된 Notion 워크스페이스 사본을 검색하고, 페이지와 데이터베이스를 찾아보며, 페이지를 Markdown 파일로 내보내도록 돕습니다.
knowledge-entities
394k에이전트가 사람, 회사, 프로젝트가 무엇인지 식별한 뒤, Knowledge 볼트에 출처가 있는 프로필 페이지를 작성하도록 돕습니다.