# config.py (erweitert) import json import os import logging from pathlib import Path # Pfade BASE_DIR = Path(__file__).parent CONFIG_DIR = BASE_DIR / "config" FEEDS_FILE = CONFIG_DIR / "feeds.json" API_KEYS_FILE = CONFIG_DIR / "api_keys.json" # Logging-Konfiguration def setup_logging(): logging.basicConfig( level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", handlers=[ logging.FileHandler("news_bot.log"), logging.StreamHandler() ] ) # Dynamische Feed-Konfiguration def load_feeds(): with open(FEEDS_FILE) as f: return json.load(f) # API-Keys def load_api_keys(): with open(API_KEYS_FILE) as f: return json.load(f) # Einstellungen SETTINGS = { "check_interval": 5, "max_retries": 3, "request_timeout": 10, "max_articles": 50 } # Kategorien und Filter CATEGORY_FILTERS = { "technology": ["AI", "Machine Learning", "Cybersecurity"], "politics": ["Election", "Government", "Policy"] }