关于 reddit
reddit 是通过 Reddit 公共 JSON API 获取帖子、评论、版块信息和用户资料的技能,适用于无需 API 密钥认证的 Reddit 数据检索与研究。
主要功能
- 01按排序和时间获取版块帖子
- 02搜索帖子并按版块筛选
- 03获取帖子详情和评论
- 04查看版块信息
- 05获取用户资料及近期帖子
适用场景
- 01研究某个主题的讨论
- 02跟踪特定版块中的帖子
- 03查看帖子及其评论
- 04检查 Reddit 用户近期动态
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ resciencelab/ opc-skills --skill reddit安装后在 Claude Code 中输入/reddit确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
.claude-plugin/plugin.jsonscripts/credential.pyget_post.pyget_posts.pyget_subreddit.pyget_user.pyreddit_api.pysearch_posts.py详细介绍
Reddit 技能
通过公共 JSON API 获取 Reddit 帖子、评论、subreddit 信息和用户资料。
前提条件
无需 API 密钥! Reddit 公共 JSON API 无需身份验证即可使用。
快速检查:
cd <skill_directory>
python3 scripts/get_posts.py python --limit 3
命令
所有命令均在技能目录中运行。
Subreddit 帖子
python3 scripts/get_posts.py python --limit 20 # Hot posts (default)
python3 scripts/get_posts.py python --sort new --limit 20
python3 scripts/get_posts.py python --sort top --time week
python3 scripts/get_posts.py python --sort top --time all --limit 10
搜索帖子
python3 scripts/search_posts.py "AI agent" --limit 20
python3 scripts/search_posts.py "MCP server" --subreddit ClaudeAI --limit 10
python3 scripts/search_posts.py "async python" --sort top --time year
Subreddit 信息
python3 scripts/get_subreddit.py python
python3 scripts/get_subreddit.py ClaudeAI
帖子与评论
python3 scripts/get_post.py abc123 # Get post by ID
python3 scripts/get_post.py abc123 --comments 50 # With more comments
用户资料
python3 scripts/get_user.py spez
python3 scripts/get_user.py spez --posts 10 # Include recent posts
排序选项
| 排序方式 | 说明 | 时间选项 |
|---|---|---|
hot | 热门帖子(默认) | - |
new | 最新帖子 | - |
top | 得票最高 | hour、day、week、month、year、all |
rising | 热度上升中 | - |
controversial | 票数分歧较大 | hour、day、week、month、year、all |
API 信息
- 方法:公共 JSON API(无需身份验证)
- 技巧:在任意 Reddit URL 后追加
.json - 速率限制:每分钟 100 次请求
- 文档:https://www.reddit.com/dev/api
评论
支持 Markdown