From cd55e353f85d1338a3122dbcfbf99e3480b10141 Mon Sep 17 00:00:00 2001 From: GerardoP Date: Tue, 3 Nov 2020 17:28:42 -0800 Subject: [PATCH] Add code to print out the timestamp of a users latest event. --- main.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index f2f1db2..33fcf2c 100644 --- a/main.py +++ b/main.py @@ -8,13 +8,8 @@ if __name__ == "__main__": username = sys.argv[1] - - # 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") - - - + response = requests.get(f'https://api.github.com/users/{username}/events') + events = json.loads(response.content) + print(events[0]['created_at'])