diff --git a/main.py b/main.py index f2f1db2..9c7ef8a 100644 --- a/main.py +++ b/main.py @@ -14,7 +14,16 @@ # 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") + # print("COMPLETE THE TODOs") + api_url = 'https://api.github.com' + try: + events = requests.get(f'{api_url}/users/{username}/events') + first = events.json()[0]['created_at'] + except: + first = None - + if first: + print(f"First event for user {username} was at {first}") + else: + print("Unable to retrieve timestamp for user.") \ No newline at end of file