summaryrefslogtreecommitdiff
path: root/news.py
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@simplelittledream.com>2022-10-01 11:10:24 -0400
committerJacob McDonnell <jacob@simplelittledream.com>2022-10-01 11:10:24 -0400
commitfc496845f27292fc4fa467ea2db9d68f0370f1e3 (patch)
tree99e0e47d056b473dc8662f32f99b39bd924391aa /news.py
parenteda301b9b27baecc69851c18cf50bd0416f894e9 (diff)
Forced Pycharm to use Tabs instead of Spaces
Diffstat (limited to 'news.py')
-rw-r--r--news.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/news.py b/news.py
index 28bb374..6c486c5 100644
--- a/news.py
+++ b/news.py
@@ -10,21 +10,21 @@ url = f"https://newsapi.org/v2/top-headlines?country={countryCode}&apiKey={apiKe
def getHeadlines():
- resp = requests.get(url)
- while resp.status_code != 200:
- resp = requests.get(url)
- sleep(10)
+ resp = requests.get(url)
+ while resp.status_code != 200:
+ resp = requests.get(url)
+ sleep(10)
- respData = json.loads(resp.text)
+ respData = json.loads(resp.text)
- articles = respData["articles"]
+ articles = respData["articles"]
- output = ["Top 5 Headlines in the US:"]
+ output = ["Top 5 Headlines in the US:"]
- for i in range(5):
- article = articles[i]
- title = article["title"]
- output.append(title)
- output.append("\n")
+ for i in range(5):
+ article = articles[i]
+ title = article["title"]
+ output.append(title)
+ output.append("\n")
- return output
+ return output