Add1E commited on
Commit
879fcaf
·
verified ·
1 Parent(s): d40588a

Update app.py

Browse files

Added Different Display Type

Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -31,12 +31,12 @@ def find_details(req_json, gewünschter_titel):
31
  if trend_info['title'] == gewünschter_titel:
32
 
33
  for article in trend_info['articles']:
34
-
35
  article_details = {
36
  'url': article['url'],
37
  'snippet': article['snippet'],
38
  'articleTitle': article['articleTitle'],
39
- 'time': article['time']
 
40
  }
41
 
42
  gewünschte_details.append(article_details)
@@ -50,7 +50,8 @@ def find_details2(req_json):
50
  'url': article['url'],
51
  'snippet': article['snippet'],
52
  'articleTitle': article['title'],
53
- #'time': article['time']
 
54
  }
55
 
56
  gewünschte_details.append(article_details)
@@ -99,7 +100,7 @@ def display_trends_from_yesterday():
99
  st.session_state[checkbox_label] = False
100
  checkbox_statuses[checkbox_label] = st.session_state.get(checkbox_label, False)
101
  checkbox_statuses[checkbox_label] = st.checkbox(
102
- f"{count2}• {link['title']} [Go To →]({link['url']})",
103
  value=checkbox_statuses[checkbox_label],
104
  key=checkbox_label
105
  )
@@ -135,7 +136,7 @@ def display_articles_for_category(category):
135
  checkbox_label = f"{category}_{index}_{count2}"
136
  disabled = not checkbox_statuses[checkbox_label] and sum(checkbox_statuses.values()) >= MAX_CHECKED
137
  checkbox_statuses[checkbox_label] = st.checkbox(
138
- f"{count2}• {url['articleTitle']} [Go To →]({url['url']})",
139
  value=checkbox_statuses[checkbox_label],
140
  key=checkbox_label,
141
  disabled=disabled
@@ -166,7 +167,7 @@ def display_articles_for_today(count, index):
166
  checkbox_label = f"today_{count}_{count2}"
167
  disabled = not checkbox_statuses[checkbox_label] and sum(checkbox_statuses.values()) >= MAX_CHECKED
168
  checkbox_statuses[checkbox_label] = st.checkbox(
169
- f"{count2}• {url['articleTitle']} [Go To →]({url['url']})",
170
  value=checkbox_statuses[checkbox_label],
171
  key=checkbox_label,
172
  disabled=disabled
 
31
  if trend_info['title'] == gewünschter_titel:
32
 
33
  for article in trend_info['articles']:
 
34
  article_details = {
35
  'url': article['url'],
36
  'snippet': article['snippet'],
37
  'articleTitle': article['articleTitle'],
38
+ 'time': article['time'],
39
+ 'source' : article['source']
40
  }
41
 
42
  gewünschte_details.append(article_details)
 
50
  'url': article['url'],
51
  'snippet': article['snippet'],
52
  'articleTitle': article['title'],
53
+ 'source' : article['source']
54
+
55
  }
56
 
57
  gewünschte_details.append(article_details)
 
100
  st.session_state[checkbox_label] = False
101
  checkbox_statuses[checkbox_label] = st.session_state.get(checkbox_label, False)
102
  checkbox_statuses[checkbox_label] = st.checkbox(
103
+ f"{count2}• {link['title']} | {link['source']} | [Go To →]({link['url']})",
104
  value=checkbox_statuses[checkbox_label],
105
  key=checkbox_label
106
  )
 
136
  checkbox_label = f"{category}_{index}_{count2}"
137
  disabled = not checkbox_statuses[checkbox_label] and sum(checkbox_statuses.values()) >= MAX_CHECKED
138
  checkbox_statuses[checkbox_label] = st.checkbox(
139
+ f"{count2}• {url['articleTitle']} | {url['source']} | [Go To →]({url['url']})",
140
  value=checkbox_statuses[checkbox_label],
141
  key=checkbox_label,
142
  disabled=disabled
 
167
  checkbox_label = f"today_{count}_{count2}"
168
  disabled = not checkbox_statuses[checkbox_label] and sum(checkbox_statuses.values()) >= MAX_CHECKED
169
  checkbox_statuses[checkbox_label] = st.checkbox(
170
+ f"{count2}• {url['articleTitle']} | {url['source']} | [Go To →]({url['url']})",
171
  value=checkbox_statuses[checkbox_label],
172
  key=checkbox_label,
173
  disabled=disabled