diff --git a/rss-generator.py b/rss-generator.py index 5072c12..3a75441 100644 --- a/rss-generator.py +++ b/rss-generator.py @@ -37,8 +37,8 @@ def fetch_apps_data(url): print(f"Error fetching data: {e}") return None -def fetch_app_description(app_id): - """Fetch the description for a specific app from its detail endpoint.""" +def fetch_app_details(app_id): + """Fetch the full app details from the detail endpoint.""" detail_url = f"https://repebblesearch.com/api/v1/apps/{app_id}" try: response = requests.get(detail_url) @@ -47,14 +47,14 @@ def fetch_app_description(app_id): # Try parsing as JSON first try: data = response.json() - return data.get('description', '') + return data except json.JSONDecodeError: # If not JSON, try to extract from response text print(f"Warning: Detail endpoint returned non-JSON for {app_id}") - return "" + return {} except requests.exceptions.RequestException as e: - print(f"Error fetching description for {app_id}: {e}") - return "" + print(f"Error fetching details for {app_id}: {e}") + return {} def format_description(text): """Convert plain text description to formatted HTML with proper line breaks and lists.""" @@ -72,11 +72,11 @@ def format_description(text): stripped = line.strip() # Check if this is a bullet point - if stripped and stripped[0] in ('-', '*', '•'): + if stripped and stripped[0] == '-': if not in_list: formatted_lines.append('