import xml.etree.ElementTree as ET

# Parse hotness
tree = ET.parse('/home/hermes/workspace/bgg-scrape/hotness_full.xml')
root = tree.getroot()

items = []
for item_elem in root.findall('item'):
    item_id = item_elem.get('id')
    rank = item_elem.get('rank')
    
    name_elem = item_elem.find('name')
    name = name_elem.get('value') if name_elem is not None else 'Unknown'
    
    year_elem = item_elem.find('yearpublished')
    year = year_elem.get('value') if year_elem is not None else 'N/A'
    
    thumb_elem = item_elem.find('thumbnail')
    thumbnail = thumb_elem.get('value') if thumb_elem is not None else ''
    
    items.append({
        'id': item_id,
        'rank': rank,
        'name': name,
        'year': year,
        'thumbnail': thumbnail
    })

print(f"Total items: {len(items)}")
for i, item in enumerate(items[:30], 1):
    print(f"{i}. [{item['rank']}] {item['name']} ({item['year']}) - ID:{item['id']}")
