Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions SetupStepsMike.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

rmvirtualenv github-latest ;***MMM to remove if it already exists
mkvirtualenv github-latest
pip install requests

6 changes: 6 additions & 0 deletions goMainRunTest.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

cmd /c python -u main.py mmanc125uw > test_results.txt
type test_results.txt



22 changes: 20 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,30 @@
if __name__ == "__main__":
username = sys.argv[1]

# TODO:
#***MMM
#username = "mmanc125uw"


# Done:
#
# 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("https://api.github.com/users/{}/events".format(username))

###diag
### ***MMM for response result see https://api.github.com/users/username/events
### ex https://api.github.com/users/mmanc125uw/events
#print(response.content)
#dict = response.json()[0]
#for key, value in dict.items():
# print(f"diag key = -{key}- value = -{value}-")
#print(f" resp json [0] keys = {response.json()[0].keys()}")
###

events = json.loads(response.content)

git_event_created_at = events[0]['created_at']
print(f"Git event for user {username} created at {git_event_created_at}")


4 changes: 4 additions & 0 deletions response.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test_results.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Git event for user mmanc125uw created at 2020-09-22T21:58:16Z