nick5363 commited on
Commit
bd3d5fc
·
verified ·
1 Parent(s): 1a988b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -9
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
- # VnExpress Kinh Doanh
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