Spaces:
Building
Building
Update app.py
Browse files
app.py
CHANGED
@@ -98,12 +98,20 @@ def format_results(results):
|
|
98 |
snippet = result.get("snippet", "λ΄μ© μμ")
|
99 |
source = result.get("source", result.get("channel", "μ μ μμ"))
|
100 |
date = result.get("date", result.get("time", "μ μ μλ μκ°"))
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
article_html = f"""
|
103 |
-
<div style="margin-bottom: 20px;">
|
104 |
<h3><a href="{link}" target="_blank">{title}</a></h3>
|
105 |
-
<p>{snippet}</p>
|
106 |
<p><strong>{source}</strong> - {date}</p>
|
|
|
|
|
107 |
</div>
|
108 |
"""
|
109 |
formatted_articles += article_html
|
|
|
98 |
snippet = result.get("snippet", "λ΄μ© μμ")
|
99 |
source = result.get("source", result.get("channel", "μ μ μμ"))
|
100 |
date = result.get("date", result.get("time", "μ μ μλ μκ°"))
|
101 |
+
image_url = result.get("thumbnail", result.get("img", ""))
|
102 |
+
|
103 |
+
# μ΄λ―Έμ§ νκ·Έ μμ±
|
104 |
+
if image_url:
|
105 |
+
image_html = f'<img src="{image_url}" alt="Image" style="max-width: 100%; height: auto;">'
|
106 |
+
else:
|
107 |
+
image_html = ''
|
108 |
+
|
109 |
article_html = f"""
|
110 |
+
<div style="margin-bottom: 20px; border-bottom: 1px solid #ccc; padding-bottom: 20px;">
|
111 |
<h3><a href="{link}" target="_blank">{title}</a></h3>
|
|
|
112 |
<p><strong>{source}</strong> - {date}</p>
|
113 |
+
{image_html}
|
114 |
+
<p>{snippet}</p>
|
115 |
</div>
|
116 |
"""
|
117 |
formatted_articles += article_html
|