import streamlit as st import pandas as pd import json import os import datetime import base64 from pathlib import Path from PIL import Image import time from selenium import webdriver from selenium.webdriver.chrome.options import Options from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.chrome.service import Service import re # Set page configuration st.set_page_config( page_title="AI Tools Directory", page_icon="🤖", layout="wide" ) # Define paths DATA_PATH = "data/ai_tools.json" IMAGES_PATH = "images" # Ensure directories exist os.makedirs(os.path.dirname(DATA_PATH), exist_ok=True) os.makedirs(IMAGES_PATH, exist_ok=True) # CSS for styling st.markdown(""" """, unsafe_allow_html=True) # Function to initialize or load AI tools data def load_ai_tools(): if os.path.exists(DATA_PATH): with open(DATA_PATH, 'r') as file: return json.load(file) else: # Initialize with the original HTML data tools = [ {"id": 1, "name": "ChatGPT", "url": "https://chat.openai.com/", "votes": 0}, {"id": 2, "name": "deepseek", "url": "https://www.deepseek.com/", "votes": 0}, {"id": 3, "name": "character.ai", "url": "https://character.ai/", "votes": 0}, {"id": 4, "name": "perplexity", "url": "https://www.perplexity.ai/", "votes": 0}, {"id": 5, "name": "JanitorAI", "url": "https://www.janitorai.com/", "votes": 0}, {"id": 6, "name": "Claude", "url": "https://claude.ai/", "votes": 0}, {"id": 7, "name": "QuillBot", "url": "https://quillbot.com/", "votes": 0}, {"id": 8, "name": "SUNO", "url": "https://www.suno.ai/", "votes": 0}, {"id": 9, "name": "SPICYCHAT.AI", "url": "https://spicychat.ai/", "votes": 0}, {"id": 10, "name": "Doubao", "url": "https://doubao.com/", "votes": 0}, {"id": 11, "name": "Moonshot AI", "url": "https://moonshot.ai/", "votes": 0}, {"id": 12, "name": "Hailuo AI", "url": "https://hailuoai.com/", "votes": 0}, {"id": 13, "name": "Hugging Face", "url": "https://huggingface.co/", "votes": 0}, {"id": 14, "name": "Poe", "url": "https://poe.com/", "votes": 0}, {"id": 15, "name": "Adot", "url": "https://www.adotdev.com/", "votes": 0}, {"id": 16, "name": "Eden AI", "url": "https://eden.ai/", "votes": 0}, {"id": 17, "name": "PolyBuzz", "url": "https://polybuzz.com/", "votes": 0}, {"id": 18, "name": "SERRAT.AI", "url": "https://serrat.ai/", "votes": 0}, {"id": 19, "name": "liner", "url": "https://liner.ai/", "votes": 0}, {"id": 20, "name": "KLING AI", "url": "https://kling.ai/", "votes": 0}, {"id": 21, "name": "CIVITAI", "url": "https://civitai.com/", "votes": 0}, {"id": 22, "name": "IIElevenLabs", "url": "https://11labs.io/", "votes": 0}, {"id": 23, "name": "Sora", "url": "https://sora.ai/", "votes": 0}, {"id": 24, "name": "Crushon AI", "url": "https://crushon.ai/", "votes": 0}, {"id": 25, "name": "BLACKBOX AI", "url": "https://blackbox.ai/", "votes": 0}, {"id": 26, "name": "DeepAI", "url": "https://deepai.org/", "votes": 0}, {"id": 27, "name": "Gamma", "url": "https://gamma.app/", "votes": 0}, {"id": 28, "name": "Leonardo.Ai", "url": "https://leonardo.ai/", "votes": 0}, {"id": 29, "name": "cutout.pro", "url": "https://cutout.pro/", "votes": 0}, {"id": 30, "name": "BRAINLY", "url": "https://brainly.com/", "votes": 0}, {"id": 31, "name": "Photoroom", "url": "https://photoroom.com/", "votes": 0}, {"id": 32, "name": "Moescape AI", "url": "https://moescape.ai/", "votes": 0}, {"id": 33, "name": "Midjourney", "url": "https://www.midjourney.com/", "votes": 0}, {"id": 34, "name": "candy.ai", "url": "https://candy.ai/", "votes": 0}, {"id": 35, "name": "zeemo", "url": "https://zeemo.ai/", "votes": 0}, {"id": 36, "name": "VEED", "url": "https://veed.io/", "votes": 0}, {"id": 37, "name": "invideo AI", "url": "https://invideo.ai/", "votes": 0}, {"id": 38, "name": "Pixelcut", "url": "https://pixelcut.ai/", "votes": 0}, {"id": 39, "name": "talkie", "url": "https://talkie.ai/", "votes": 0}, {"id": 40, "name": "PixAI", "url": "https://pixa.ai/", "votes": 0}, {"id": 41, "name": "Monica", "url": "https://monica.im/", "votes": 0}, {"id": 42, "name": "CURSOR", "url": "https://cursor.sh/", "votes": 0}, {"id": 43, "name": "ideogram", "url": "https://ideogram.ai/", "votes": 0}, {"id": 44, "name": "CHUB", "url": "https://chub.ai/", "votes": 0}, {"id": 45, "name": "Clipchamp", "url": "https://clipchamp.com/", "votes": 0}, {"id": 46, "name": "Meta AI", "url": "https://meta.ai/", "votes": 0}, {"id": 47, "name": "StudyX", "url": "https://www.studyx.ai/", "votes": 0}, {"id": 48, "name": "bolt", "url": "https://bolt.ai/", "votes": 0}, {"id": 49, "name": "PicWish", "url": "https://picwish.com/", "votes": 0}, {"id": 50, "name": "Joyland", "url": "https://joyland.ai/", "votes": 0} ] save_ai_tools(tools) return tools # Function to save AI tools data def save_ai_tools(tools): with open(DATA_PATH, 'w') as file: json.dump(tools, file, indent=4) # Function to generate HTML from tools data def generate_html(tools): html = """
{i+j+1}.
{tool['name']}
|
"""
html += "