ทักษะ Reddit
ดึงโพสต์ ความคิดเห็น ข้อมูลซับเรดดิท และโปรไฟล์ผู้ใช้จาก Reddit ผ่าน JSON API สาธารณะ
ข้อกำหนดเบื้องต้น
ไม่จำเป็นต้องใช้คีย์ API! JSON API สาธารณะของ Reddit ทำงานได้โดยไม่ต้องผ่านการตรวจสอบความถูกต้อง
ตรวจสอบอย่างรวดเร็ว:
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 สาธารณะ (ไม่จำเป็นต้องผ่านการตรวจสอบ)
- เคล็ดลับ: เพิ่ม
.jsonต่อท้าย URL ของ Reddit ใด ๆ - ขีดจำกัดอัตราการร้องขอ: 100 คำขอ/นาที
- เอกสาร: https://www.reddit.com/dev/api


