Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import requests
|
|
3 |
from newspaper import Article
|
4 |
from transformers import pipeline
|
5 |
import config
|
|
|
6 |
import nltk
|
7 |
|
8 |
|
@@ -61,8 +62,9 @@ def summarize_input(mixed_input):
|
|
61 |
# Function to fetch top headlines from NewsAPI and summarize them
|
62 |
def fetch_news():
|
63 |
url = 'https://newsapi.org/v2/top-headlines'
|
|
|
64 |
params = {
|
65 |
-
'apiKey':
|
66 |
'language': 'en',
|
67 |
'sources': 'associated-press',
|
68 |
'pageSize': 10
|
|
|
3 |
from newspaper import Article
|
4 |
from transformers import pipeline
|
5 |
import config
|
6 |
+
import os
|
7 |
import nltk
|
8 |
|
9 |
|
|
|
62 |
# Function to fetch top headlines from NewsAPI and summarize them
|
63 |
def fetch_news():
|
64 |
url = 'https://newsapi.org/v2/top-headlines'
|
65 |
+
api_key = os.environ.get("api_key")
|
66 |
params = {
|
67 |
+
'apiKey': api_key,
|
68 |
'language': 'en',
|
69 |
'sources': 'associated-press',
|
70 |
'pageSize': 10
|