shaina commited on
Commit
10f5468
1 Parent(s): bb5facb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -26
app.py CHANGED
@@ -130,33 +130,20 @@ def main():
130
  st.error("Sorry! Couldn't process the request")
131
 
132
  st.header("Latest Covid News")
133
- col1, col2= st.beta_columns([4,4])
134
  latest_news = news()
135
- for i in latest_news[0:6]:
136
- if i in [0, 2, 4]:
137
- with col1:
138
- st.write(i['title'])
139
- st.image(
140
- i['img'],
141
- width=100, # Manually Adjust the width of the image as per requirement
142
- )
143
- link_ = i['link']
144
- link_ = link_.replace("news.google.com/.", "https://news.google.com")
145
- link_path = "read this [article]" + "(" + link_ + ")"
146
- st.write(link_path)
147
- st.write(" ")
148
- elif i in [1, 3, 5]:
149
- with col2:
150
- st.write(i['title'])
151
- st.image(
152
- i['img'],
153
- width=100, # Manually Adjust the width of the image as per requirement
154
- )
155
- link_ = i['link']
156
- link_ = link_.replace("news.google.com/.", "https://news.google.com")
157
- link_path = "read this [article]" + "(" + link_ + ")"
158
- st.write(link_path)
159
- st.write(" ")
160
 
161
  if __name__ == "__main__":
162
  main()
 
130
  st.error("Sorry! Couldn't process the request")
131
 
132
  st.header("Latest Covid News")
 
133
  latest_news = news()
134
+ for i in latest_news[0:5]:
135
+ with col1:
136
+ st.write(i['title'])
137
+ st.image(
138
+ i['img'],
139
+ width=100, # Manually Adjust the width of the image as per requirement
140
+ )
141
+ link_ = i['link']
142
+ link_ = link_.replace("news.google.com/.", "https://news.google.com")
143
+ link_path = "read this [article]" + "(" + link_ + ")"
144
+ st.write(link_path)
145
+ st.write(" ")
146
+
 
 
 
 
 
 
 
 
 
 
 
 
147
 
148
  if __name__ == "__main__":
149
  main()