harao-ml commited on
Commit
8ab25b3
·
verified ·
1 Parent(s): 673fb52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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': config.api_key,
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