Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -130,18 +130,33 @@ def 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:
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
|
146 |
if __name__ == "__main__":
|
147 |
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 |
+
else:
|
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()
|