#!/usr/bin/env python3
import requests
import json

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
}

url = 'https://old.reddit.com/r/FLMedicalTrees/new.json?limit=25'
try:
    r = requests.get(url, headers=headers, timeout=10)
    r.raise_for_status()
    data = r.json()
    
    posts = [p['data'] for p in data['data']['children']]
    
    for i, p in enumerate(posts[:15], 1):
        print(f"\n--- POST {i} ---")
        print(f"Title: {p['title']}")
        print(f"Author: u/{p['author']}")
        print(f"URL: https://old.reddit.com{p['permalink']}")
        print(f"Created: {p['created_utc']}")
        if p.get('selftext'):
            print(f"Text: {p['selftext'][:200]}...")
except Exception as e:
    print(f"Error: {e}")
