Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,14 +44,14 @@ def search_wikipedia(keyword, max_results=20):
|
|
| 44 |
|
| 45 |
# Generate HTML with Tailwind-styled cards
|
| 46 |
html_output = """
|
| 47 |
-
<
|
| 48 |
-
<div class="max-w-
|
| 49 |
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
| 50 |
"""
|
| 51 |
for item in output:
|
| 52 |
url_link = f'<a href="{item["URL"]}" target="_blank" class="text-blue-500 hover:text-blue-700 font-medium">Read on Wikipedia</a>' if item["URL"] != "N/A" else "No link available"
|
| 53 |
html_output += f"""
|
| 54 |
-
<div class="bg-white rounded-xl shadow-lg hover:shadow-2xl transition-shadow duration-300 p-
|
| 55 |
<h2 class="text-xl font-bold text-gray-800 mb-3">{item["Title"]}</h2>
|
| 56 |
<p class="text-gray-600 mb-4">{item["Summary"]}</p>
|
| 57 |
<div class="text-sm">{url_link}</div>
|
|
@@ -63,7 +63,7 @@ def search_wikipedia(keyword, max_results=20):
|
|
| 63 |
|
| 64 |
except Exception as e:
|
| 65 |
return """
|
| 66 |
-
<
|
| 67 |
<div class="max-w-7xl mx-auto p-4">
|
| 68 |
<div class="bg-red-100 border-l-4 border-red-500 text-red-700 p-4 rounded-lg">
|
| 69 |
An error occurred: {str(e)}
|
|
|
|
| 44 |
|
| 45 |
# Generate HTML with Tailwind-styled cards
|
| 46 |
html_output = """
|
| 47 |
+
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
|
| 48 |
+
<div class="max-w-5xl mx-auto p-4 container">
|
| 49 |
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
| 50 |
"""
|
| 51 |
for item in output:
|
| 52 |
url_link = f'<a href="{item["URL"]}" target="_blank" class="text-blue-500 hover:text-blue-700 font-medium">Read on Wikipedia</a>' if item["URL"] != "N/A" else "No link available"
|
| 53 |
html_output += f"""
|
| 54 |
+
<div class="bg-white rounded-xl shadow-lg hover:shadow-2xl transition-shadow duration-300 p-4">
|
| 55 |
<h2 class="text-xl font-bold text-gray-800 mb-3">{item["Title"]}</h2>
|
| 56 |
<p class="text-gray-600 mb-4">{item["Summary"]}</p>
|
| 57 |
<div class="text-sm">{url_link}</div>
|
|
|
|
| 63 |
|
| 64 |
except Exception as e:
|
| 65 |
return """
|
| 66 |
+
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
|
| 67 |
<div class="max-w-7xl mx-auto p-4">
|
| 68 |
<div class="bg-red-100 border-l-4 border-red-500 text-red-700 p-4 rounded-lg">
|
| 69 |
An error occurred: {str(e)}
|