← All one-liners·#003·discovery·self contained·beginner

Top posts of any subreddit, today

Reddit's free JSON API is the cheapest way to get community signal. Works on every subreddit, no key needed.

The one-liner
$ curl -s -A "oneliner101/1.0" \
     "https://www.reddit.com/r/LocalLLaMA/top.json?limit=25&t=day" \
  | jq -r '.data.children[].data | select(.score > 50)
            | "[\(.score)↑ \(.num_comments)💬] \(.title)"'
What each stage does
  1. [01] curlcurl -s -A "oneliner101/1.0" "https://www.reddit.com/r/LocalLLaMA/top.json?limit…
    Reddit JSON endpoint. -A sets a custom User-Agent (Reddit blocks the default curl UA). t=day|week|month|year|all controls the time window.
  2. [02] jqjq -r '.data.children[].data | select(.score > 50) | "[\(.score)↑ \(.num_comment…
    Unwrap .data.children[].data (Reddit's deep envelope), keep only posts with score>50, format as `[score↑ comments💬] title`.
Expected output (sample)
[823↑ 142💬] Llama 4 70B released, here are the first benchmarks
[412↑ 89💬] Local-first agentic RAG with hybrid retrieval
...
Caveats & tips
  • Reddit's User-Agent block is real — without -A you get 429s within seconds.
  • Add .selftext to the jq projection if you want post bodies, not just titles.