Compare commits

..

No commits in common. "168a2a99848319663ea50cf5531f18f0a0157334" and "a68d4895cdddca98e51f2c7c9255cfb8c89633ca" have entirely different histories.

21 changed files with 21 additions and 40 deletions

View File

@ -2,10 +2,9 @@
<module type="PYTHON_MODULE" version="4"> <module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.venv" />
<excludeFolder url="file://$MODULE_DIR$/venv" /> <excludeFolder url="file://$MODULE_DIR$/venv" />
</content> </content>
<orderEntry type="jdk" jdkName="Python 3.13 (Final)" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="Python 3.13 (pythonProject)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
<component name="PyDocumentationSettings"> <component name="PyDocumentationSettings">

View File

@ -3,5 +3,5 @@
<component name="Black"> <component name="Black">
<option name="sdkName" value="Python 3.11.2 WSL (Debian): (/home/santi/.virtualenvs/Final/bin/python)" /> <option name="sdkName" value="Python 3.11.2 WSL (Debian): (/home/santi/.virtualenvs/Final/bin/python)" />
</component> </component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13 (Final)" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13 (pythonProject)" project-jdk-type="Python SDK" />
</project> </project>

View File

@ -152,7 +152,7 @@ frame_right.rowconfigure(0, weight=3)
frame_right.rowconfigure(1, weight=1) frame_right.rowconfigure(1, weight=1)
frame_right.columnconfigure(0, weight=1) frame_right.columnconfigure(0, weight=1)
# Create and place the chat frame and music player tab update # Create and place the chat frame and music player tab
chat_frame = ChatTab(frame_chat, chat_server_url=config_manager.config["Chat"]["server"], chat_frame = ChatTab(frame_chat, chat_server_url=config_manager.config["Chat"]["server"],
sender_name=config_manager.config["Chat"]["name"], sender_name=config_manager.config["Chat"]["name"],
stop_event=stop_event, width=200, bg="lightgreen", refresh_rate=1) stop_event=stop_event, width=200, bg="lightgreen", refresh_rate=1)

View File

@ -33,43 +33,25 @@ class WebScrapingTab(ThreadedTab):
self.data_listbox.pack(pady=10) self.data_listbox.pack(pady=10)
def create_database(self): def create_database(self):
try: # Connect to MySQL database
# Conectar sin especificar la base de datos conn = mysql.connector.connect(
conn = mysql.connector.connect( host="127.0.0.1 ",
host="127.0.0.1", user="santipy",
user="santipy", password="1234",
password="1234" database="scraping_db"
) )
cursor = conn.cursor() cursor = conn.cursor()
# Crear la base de datos si no existe # Crear la tabla si no existe
cursor.execute("CREATE DATABASE IF NOT EXISTS scraping_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci") cursor.execute("""
conn.commit() CREATE TABLE IF NOT EXISTS scraped_data (
id INT AUTO_INCREMENT PRIMARY KEY,
# Conectar a la base de datos title VARCHAR(255),
conn = mysql.connector.connect( link TEXT
host="127.0.0.1", )
user="santipy", """)
password="1234", conn.commit()
database="scraping_db" return conn
)
# Crear la tabla si no existe
cursor = conn.cursor()
cursor.execute("""
CREATE TABLE IF NOT EXISTS scraped_data (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255),
link TEXT
)
""")
conn.commit()
return conn
except mysql.connector.Error as err:
print(f"Error al conectar o crear la base de datos: {err}")
messagebox.showerror("Database Error", f"Error al conectar o crear la base de datos: {err}")
return None
def save_to_database(self): def save_to_database(self):