Tomás F commited on
Commit
db083db
1 Parent(s): 8ad6cb1

Only show images if available

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -77,9 +77,10 @@ with st.spinner('⚙️ Analysing articles...'):
77
  st.sidebar.metric("Negative", f"👎 {sentiment_distribution.get('negative'):.2f}%")
78
 
79
  for article, sentiment in filter_with_sentiment(classified_articles, target_sentiments):
80
- img_url = article.media_content[0].get('url')
81
-
82
- st.image(img_url, width=300)
 
83
  st.markdown(
84
  f'''
85
  #### {article.title}
 
77
  st.sidebar.metric("Negative", f"👎 {sentiment_distribution.get('negative'):.2f}%")
78
 
79
  for article, sentiment in filter_with_sentiment(classified_articles, target_sentiments):
80
+ if article.media_contet:
81
+ img_url = article.media_content[0].get('url')
82
+ st.image(img_url, width=300)
83
+
84
  st.markdown(
85
  f'''
86
  #### {article.title}