David Li commited on
Commit
c9d624f
·
1 Parent(s): 79d577e

fix: adding news module and more

Browse files
Files changed (2) hide show
  1. pages/news.py +16 -0
  2. requirements.txt +1 -1
pages/news.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from openbb_terminal import get_news
3
+
4
+ def fetch_news(keyword):
5
+ # This is where you would call a news API or scrape a news website
6
+ # to get news articles related to the user's keyword
7
+ # For this example, we'll just return a string with the keyword
8
+ return get_news(keyword)
9
+
10
+ # Create a text input and store the user's input in a variable
11
+ user_input = st.text_input("Enter a keyword to search for news articles")
12
+
13
+ # Call the get_news function with the user's input and display the results
14
+ if user_input:
15
+ news = get_news(user_input)
16
+ st.write(news)
requirements.txt CHANGED
@@ -1,3 +1,3 @@
1
- openbb
2
  streamlit
3
  yfinance
 
1
+ git+https://github.com/OpenBB-finance/OpenBBTerminal.git
2
  streamlit
3
  yfinance