Spaces:
Running
Running
Update gather_news.py
Browse files- gather_news.py +2 -2
gather_news.py
CHANGED
@@ -7,7 +7,7 @@ import requests
|
|
7 |
import os
|
8 |
from extract_news import extract_news_articles, create_dataframe, save_to_csv
|
9 |
|
10 |
-
def fetch_newsapi_top_headlines(min_length=100, max_articles=
|
11 |
#import config
|
12 |
url = 'https://newsapi.org/v2/top-headlines'
|
13 |
api_key = os.environ.get("api_key")
|
@@ -117,7 +117,7 @@ def fetch_newsapi_everything(topic, min_length=100, max_articles=50):
|
|
117 |
print(f"Usable articles after extraction (NewsAPI Everything): {len(merged_articles)}")
|
118 |
return merged_articles
|
119 |
|
120 |
-
def fetch_articles(topic=None, min_length=100, max_articles=
|
121 |
if topic and topic.strip():
|
122 |
return fetch_newsapi_everything(topic, min_length=min_length, max_articles=max_articles)
|
123 |
else:
|
|
|
7 |
import os
|
8 |
from extract_news import extract_news_articles, create_dataframe, save_to_csv
|
9 |
|
10 |
+
def fetch_newsapi_top_headlines(min_length=100, max_articles=25):
|
11 |
#import config
|
12 |
url = 'https://newsapi.org/v2/top-headlines'
|
13 |
api_key = os.environ.get("api_key")
|
|
|
117 |
print(f"Usable articles after extraction (NewsAPI Everything): {len(merged_articles)}")
|
118 |
return merged_articles
|
119 |
|
120 |
+
def fetch_articles(topic=None, min_length=100, max_articles=25):
|
121 |
if topic and topic.strip():
|
122 |
return fetch_newsapi_everything(topic, min_length=min_length, max_articles=max_articles)
|
123 |
else:
|