#!/usr/bin/env python3
import paramiko

HOST = "135.125.102.180"
USER = "ubuntu"
PASS = "BotPascal2026!"

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(HOST, username=USER, password=PASS)

print("📊 Checking spam.csv status on VPS...")
print("=" * 80)

# Check if file exists
stdin, stdout, stderr = ssh.exec_command("ls -lh /var/www/html/repondeur_mail_grok/data/spam.csv")
exists = stdout.read().decode().strip()
print(f"File info: {exists}\n")

# Count spam keywords
stdin2, stdout2, stderr2 = ssh.exec_command("wc -l /var/www/html/repondeur_mail_grok/data/spam.csv")
count = stdout2.read().decode().strip()
print(f"Line count: {count}")

# Show first 10 keywords
print("\n📝 First 10 spam keywords:")
stdin3, stdout3, stderr3 = ssh.exec_command("head -11 /var/www/html/repondeur_mail_grok/data/spam.csv")
keywords = stdout3.read().decode()
print(keywords)

ssh.close()
print("\n✅ Spam keywords are safe on VPS!")
