Reddit 技能
透過公開 JSON API 從 Reddit 取得貼文、留言、子版塊資訊和使用者個人資料。
先決條件
無需 API 金鑰! Reddit 的公開 JSON API 無需驗證即可運作。
快速檢查:
cd <skill_directory>
python3 scripts/get_posts.py python --limit 3
指令
所有指令從技能目錄執行。
子版塊貼文
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
子版塊資訊
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 | 最高票貼文 | 小時、天、週、月、年、全部 |
rising | 崛起中貼文 | - |
controversial | 爭議性貼文 | 小時、天、週、月、年、全部 |
API 資訊
- 方法:公開 JSON API(無需驗證)
- 技巧:在任何 Reddit URL 後加上
.json - 速率限制:每分鐘 100 個請求
- 文件:https://www.reddit.com/dev/api