From 2bde64961796cd7e27c4d94254dc761b4a06dd68 Mon Sep 17 00:00:00 2001 From: Colleen Kaku Date: Tue, 2 Mar 2021 17:10:04 -0800 Subject: [PATCH] Completed github-latest-activity script. --- main.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index f2f1db2..660bdc5 100644 --- a/main.py +++ b/main.py @@ -9,12 +9,11 @@ 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. + response = requests.get('https://api.github.com/users/{}/events'.format(username)) + events = response.json() + timestamp = events[0]['created_at'] - print("COMPLETE THE TODOs") + print(timestamp)