From 1d90a68d0e9cd0fd363593bbd4054efb20df1df7 Mon Sep 17 00:00:00 2001 From: Mark L Taylor Date: Thu, 15 Apr 2021 20:43:41 -0700 Subject: [PATCH] Completed Lesson 06 activity --- main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index f2f1db2..df042ef 100644 --- a/main.py +++ b/main.py @@ -6,15 +6,16 @@ # Use Like python githubber.py JASchilz # (or another user name) + + 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/public".format(username)) + events = json.loads(response.content) + + print(events[0]['created_at']) - print("COMPLETE THE TODOs")