Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,16 @@ def get_combined_news():
|
|
| 9 |
result = "\n\n"
|
| 10 |
index = 1
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
# Marketaux
|
| 13 |
try:
|
| 14 |
url = f"https://api.marketaux.com/v1/news/all?language=en&limit=3&api_token={API_KEY}"
|
|
@@ -33,15 +43,7 @@ def get_combined_news():
|
|
| 33 |
except:
|
| 34 |
result += "*Lỗi khi lấy từ Google RSS*\n\n"
|
| 35 |
|
| 36 |
-
|
| 37 |
-
try:
|
| 38 |
-
vnexpress_url = "https://vnexpress.net/rss/kinh-doanh.rss"
|
| 39 |
-
vn_feed = feedparser.parse(vnexpress_url)
|
| 40 |
-
for entry in vn_feed.entries[:5]:
|
| 41 |
-
result += f"**{index}. [{entry.title}]({entry.link})** \n<sub>{entry.published}</sub>\n\n"
|
| 42 |
-
index += 1
|
| 43 |
-
except:
|
| 44 |
-
result += "*Lỗi khi lấy tin từ VnExpress*\n\n"
|
| 45 |
|
| 46 |
return result
|
| 47 |
|
|
|
|
| 9 |
result = "\n\n"
|
| 10 |
index = 1
|
| 11 |
|
| 12 |
+
# VnExpress Kinh Doanh
|
| 13 |
+
try:
|
| 14 |
+
vnexpress_url = "https://vnexpress.net/rss/kinh-doanh.rss"
|
| 15 |
+
vn_feed = feedparser.parse(vnexpress_url)
|
| 16 |
+
for entry in vn_feed.entries[:5]:
|
| 17 |
+
result += f"**{index}. [{entry.title}]({entry.link})** \n<sub>{entry.published}</sub>\n\n"
|
| 18 |
+
index += 1
|
| 19 |
+
except:
|
| 20 |
+
result += "*Lỗi khi lấy tin từ VnExpress*\n\n"
|
| 21 |
+
|
| 22 |
# Marketaux
|
| 23 |
try:
|
| 24 |
url = f"https://api.marketaux.com/v1/news/all?language=en&limit=3&api_token={API_KEY}"
|
|
|
|
| 43 |
except:
|
| 44 |
result += "*Lỗi khi lấy từ Google RSS*\n\n"
|
| 45 |
|
| 46 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
return result
|
| 49 |
|