Anne314159 commited on
Commit
8fd37ed
·
verified ·
1 Parent(s): 84dcafd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -9
app.py CHANGED
@@ -19,17 +19,19 @@ def fetch_trending_news(niche):
19
 
20
  # Define the pages
21
  def page_trending_niche():
22
- st.title("What is trending in my niche?")
23
- st.image('Robot.png', use_column_width=True)
 
 
 
 
24
 
25
  niche = st.text_input('Enter your niche', 'German clinics')
26
- st.write(f"Trending news in {niche}:")
27
-
28
- trending_news = fetch_trending_news(niche)
29
- for idx, news_item in enumerate(trending_news, start=1):
30
- st.write(f"{idx}. {news_item}")
31
-
32
-
33
 
34
  # Define the pages
35
  def page_social_media_generator():
 
19
 
20
  # Define the pages
21
  def page_trending_niche():
22
+ # Using st.columns to create a two-column layout
23
+ col1, col2 = st.columns([3, 1])
24
+ with col1:
25
+ st.title("What is trending in my niche?")
26
+ with col2:
27
+ st.image('Robot.png', use_column_width=True)
28
 
29
  niche = st.text_input('Enter your niche', 'German clinics')
30
+ if st.button('Fetch Trending News'):
31
+ st.write(f"Trending news in {niche}:")
32
+ trending_news = fetch_trending_news(niche)
33
+ for idx, news_item in enumerate(trending_news, start=1):
34
+ st.write(f"{idx}. {news_item}")
 
 
35
 
36
  # Define the pages
37
  def page_social_media_generator():