#!/bin/bash
echo "Testing API:"
echo "1. List packages for A01:"
curl -s "http://localhost:8000/api/publisher/packages/A01" | python3 -m json.tool

echo ""
echo "2. Get package HTML for 知乎:"
curl -s "http://localhost:8000/api/publisher/package/A01/知乎" | python3 -c "import sys, json; data=json.load(sys.stdin); print('HTML length:', len(data.get('html',0)))" 2>&1

echo ""
echo "3. Get package HTML for 小红书:"
curl -s "http://localhost:8000/api/publisher/package/A01/小红书" | python3 -c "import sys, json; data=json.load(sys.stdin); print('HTML length:', len(data.get('html',0)))" 2>&1
