Tomás F commited on
Commit
6bc492b
1 Parent(s): 74de87c

Fix published date attribute name

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -58,7 +58,7 @@ target_sentiments = st.sidebar.multiselect(
58
  with st.spinner('📰 Loading articles...'):
59
  target_articles = load_news(
60
  rss_feeds.get(target_source)
61
- ).sort(key=lambda a: a.pubDate)
62
 
63
  with st.spinner('⚙️ Analysing articles...'):
64
  classified_articles = classify_articles(target_articles, pipe)
@@ -85,6 +85,7 @@ for article, sentiment in filter_with_sentiment(classified_articles, target_sent
85
  st.markdown(
86
  f'''
87
  #### {article.title}
 
88
  **Sentiment:** {sentiment.get('label').capitalize()}
89
  '''
90
  )
 
58
  with st.spinner('📰 Loading articles...'):
59
  target_articles = load_news(
60
  rss_feeds.get(target_source)
61
+ ).sort(key=lambda a: a.published_parsed)
62
 
63
  with st.spinner('⚙️ Analysing articles...'):
64
  classified_articles = classify_articles(target_articles, pipe)
 
85
  st.markdown(
86
  f'''
87
  #### {article.title}
88
+ Published on {article.published_parsed}
89
  **Sentiment:** {sentiment.get('label').capitalize()}
90
  '''
91
  )