j
Reddit Scraper
Scanned@javicasper
npx machina-cli add skill @javicasper/reddit-scraper --openclawFiles (1)
SKILL.md
2.9 KB
Reddit Skill 📰
Read and search Reddit posts using the public JSON API. No API key required.
Quick Start
# Read top posts from a subreddit
python3 /root/clawd/skills/reddit/scripts/reddit_scraper.py --subreddit LocalLLaMA --limit 5
# Search for posts
python3 /root/clawd/skills/reddit/scripts/reddit_scraper.py --search "clawdbot" --limit 5
# Read newest posts
python3 /root/clawd/skills/reddit/scripts/reddit_scraper.py --subreddit ClaudeAI --sort nuevos --limit 5
Options
| Option | Short | Description | Default |
|---|---|---|---|
--subreddit | -s | Subreddit name (without r/) | - |
--search | -q | Search query | - |
--sort | - | Sort: hot, new, top, populares, nuevos, rising | top |
--time | -t | Time filter: hour, day, week, month, year, all | day |
--limit | -n | Number of posts (max 100) | 25 |
--json | -j | Output as JSON | false |
--verbose | -v | Show post preview text | false |
Examples
Read subreddit posts
# Top posts of the day (default)
python3 /root/clawd/skills/reddit/scripts/reddit_scraper.py --subreddit programming
# Hot posts
python3 /root/clawd/skills/reddit/scripts/reddit_scraper.py --subreddit programming --sort hot
# New posts
python3 /root/clawd/skills/reddit/scripts/reddit_scraper.py --subreddit programming --sort nuevos
# Top posts of the week
python3 /root/clawd/skills/reddit/scripts/reddit_scraper.py --subreddit programming --sort top --time week
Search posts
# Search all of Reddit
python3 /root/clawd/skills/reddit/scripts/reddit_scraper.py --search "machine learning"
# Search within a subreddit
python3 /root/clawd/skills/reddit/scripts/reddit_scraper.py --subreddit selfhosted --search "docker"
# Search with time filter
python3 /root/clawd/skills/reddit/scripts/reddit_scraper.py --search "AI news" --time week
JSON output
# Get raw JSON data for processing
python3 /root/clawd/skills/reddit/scripts/reddit_scraper.py --subreddit technology --limit 3 --json
Output Fields (JSON)
title: Post titleauthor: Usernamescore: Upvotes (net)num_comments: Comment counturl: Link URLpermalink: Reddit discussion URLsubreddit: Subreddit namecreated_utc: Unix timestampselftext: Post text (first 200 chars)upvote_ratio: Upvote percentage (0-1)
Limitations
- Read-only: Cannot post, comment, or vote
- Rate limits: Reddit may rate-limit if too many requests
- No auth: Some content may be restricted
Technical Details
See TECHNICAL.md for implementation details.
Overview
Reads and searches Reddit posts by scraping old.reddit.com. It lets Clawdbot read posts from subreddits, search topics, and monitor communities without posting or commenting. The tool outputs structured post data to support analysis and automation.
How This Skill Works
The scraper accesses Reddit endpoints via a Python script with configurable options such as --subreddit, --search, --sort, --time, and --limit. It returns structured JSON including title, author, score, number of comments, URLs, subreddit, and created_utc. The operation is read-only and mindful of rate limits.
When to Use It
- Need to browse Reddit content without posting or commenting
- Monitor a subreddit for new posts matching a topic
- Gather top, hot, or new posts for a subreddit for analysis
- Search Reddit for mentions of a term across all communities
- Produce JSON-ready data for pipelines or dashboards
Quick Start
- Step 1: python3 /root/clawd/skills/reddit/scripts/reddit_scraper.py --subreddit LocalLLaMA --limit 5
- Step 2: python3 /root/clawd/skills/reddit/scripts/reddit_scraper.py --search "clawdbot" --limit 5
- Step 3: python3 /root/clawd/skills/reddit/scripts/reddit_scraper.py --subreddit technology --limit 3 --json
Best Practices
- Prefer --json for machine-readable output in pipelines
- Respect Reddit rate limits and keep requests light
- Target queries with --subreddit and --search to reduce noise
- Limit results with --limit to match your analysis needs
- Validate and sanitize fields like created_utc and url in downstream steps
Example Use Cases
- Read top posts from r/programming to track trends
- Search for 'clawdbot' across Reddit to gauge mentions
- Fetch newest posts in r/ClaudeAI for monitoring
- Export a few posts in JSON for sentiment analysis
- Monitor a subreddit for Docker-related topics in selfhosted
Frequently Asked Questions
Add this skill to your agents