Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ device = "cpu" # Force CPU since no GPU is available in Hugging Face Spaces
|
|
27 |
# -------------------------
|
28 |
# News Extraction Functions
|
29 |
# -------------------------
|
30 |
-
def fetch_and_scrape_news(company, api_key, count=
|
31 |
print("Starting news fetch from NewsAPI...")
|
32 |
newsapi = NewsApiClient(api_key=api_key)
|
33 |
all_articles = newsapi.get_everything(q=company, language='en', sort_by='relevancy', page_size=count)
|
|
|
27 |
# -------------------------
|
28 |
# News Extraction Functions
|
29 |
# -------------------------
|
30 |
+
def fetch_and_scrape_news(company, api_key, count=1, output_file='news_articles.xlsx'):
|
31 |
print("Starting news fetch from NewsAPI...")
|
32 |
newsapi = NewsApiClient(api_key=api_key)
|
33 |
all_articles = newsapi.get_everything(q=company, language='en', sort_by='relevancy', page_size=count)
|