import sqlite3

# Connect to your SQLite database (or create it)
conn = sqlite3.connect('database.sqlite')
cursor = conn.cursor()

# Create the table if it doesn't exist


# Open the text file containing the keywords
with open('t.txt', 'r') as file:
    # Read each line (keyword) from the file
    for line in file:
        keyword = line.strip()  # Remove any leading/trailing whitespace
        if keyword:  # Only insert non-empty lines
            try:
                # Insert the keyword into the database
               # cursor.execute('INSERT INTO pattern_lists (collection,type,value,example) VALUES ("Human Resource","Employee Records Keywords",?)', (keyword,))
                cursor.execute('INSERT INTO websites(collection,domain,ip) VALUES ("File Upload",?,"Dynamic")', (keyword,))
            except sqlite3.IntegrityError:
                # Skip duplicates
                print(f"Duplicate keyword: {keyword}")

# Commit changes and close the connection
conn.commit()
conn.close()

print("Keywords imported successfully!")
