From d57e9b16f07bd11d18bc7d70a30bb1212bc1a444 Mon Sep 17 00:00:00 2001 From: Ian Mayther Date: Thu, 17 Jun 2021 05:57:22 -0700 Subject: [PATCH 1/2] Intital commit --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index f2f1db2..07ad9f8 100644 --- a/main.py +++ b/main.py @@ -7,8 +7,11 @@ # (or another user name) if __name__ == "__main__": - username = sys.argv[1] + username = sys.argv[0] + response = requests.get("https://api.github.com/users/%7Buser%7D".format(user='IanMayther')) + + print(response.json()['events_url']) # TODO: # # 1. Retrieve a list of "events" associated with the given user name From e5cfec43f15f7235cbf9526d1e900f5902438913 Mon Sep 17 00:00:00 2001 From: Ian Mayther Date: Sun, 20 Jun 2021 14:28:44 -0700 Subject: [PATCH 2/2] Completed CLI name and events --- main.py | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/main.py b/main.py index 07ad9f8..39b6a65 100644 --- a/main.py +++ b/main.py @@ -3,21 +3,17 @@ import requests -# Use Like python githubber.py JASchilz -# (or another user name) - if __name__ == "__main__": - username = sys.argv[0] - - response = requests.get("https://api.github.com/users/%7Buser%7D".format(user='IanMayther')) - - print(response.json()['events_url']) - # TODO: - # - # 1. Retrieve a list of "events" associated with the given user name - # 2. Print out the time stamp associated with the first event in that list. - - print("COMPLETE THE TODOs") + act_user = True - - + while act_user: + username = input('Please provide username for event retrival: ') + response = requests.get("https://api.github.com/users/%7Buser%7D/events/public".format(user=username)) + try: + timestamp = response.json()[0]['created_at'] + print('First Event in List Created at: ', timestamp) + act_user = False + except IndexError: + print('Please confirm User Id is accurate') + + print("COMPLETE THE TODOs -- Thank You")