Skip to content

Commit e5ed93d

Browse files
authored
Update newsapi.py
1 parent c2a9d76 commit e5ed93d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

speech_recognition_news/newsapi.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import os
22
import requests
33
import json
4+
import nltk
45
from dotenv import load_dotenv, find_dotenv
56
from newspaper import Article
6-
from newspaper import Config
77
from datetime import datetime
8+
from newspaper import Config
89
from datetime import datetime
910

1011
news_information = dict()
@@ -16,7 +17,7 @@
1617

1718

1819
def get_top_news(news_information, todays_date):
19-
load_dotenv(find_dotenv(r"path to environmental variable"))
20+
load_dotenv(find_dotenv(r"path to env variable"))
2021
news_api_key = os.getenv("news_api")
2122
params = (
2223
('country', 'us'),
@@ -51,6 +52,3 @@ def json_file(news_information, todays_date):
5152
with open(f"news_summary/news_summary {todays_date}.txt", "w") as outfile:
5253
outfile.write(json_file)
5354
outfile.close()
54-
55-
56-

0 commit comments

Comments
 (0)