import os import random # ========================= # BACA FILE # ========================= with open("users.txt", "r", encoding="utf-8") as f: brands = [x.strip() for x in f if x.strip()] with open("admin.txt", "r", encoding="utf-8") as f: titles = [x.strip() for x in f if x.strip()] with open("database.txt", "r", encoding="utf-8") as f: descriptions = [x.strip() for x in f if x.strip()] with open("path.txt", "r", encoding="utf-8") as f: canonicals = [x.strip() for x in f if x.strip()] # ========================= # TEMPLATE HTML # ========================= html_template = """ {brand} ✪ {title}
""" for i, brand in enumerate(brands): title = titles[i] description = descriptions[i] canonical_url = canonicals[i] filename = f"{brand}.html" html_content = html_template.format( title=title, description=description, canonical=canonical_url, brand=brand ) with open(filename, "w", encoding="utf-8") as f: f.write(html_content) print("Success:", filename)