From a1a70d8563e0ae786c936338b079ef51a627099b Mon Sep 17 00:00:00 2001 From: geekwriter2 Date: Tue, 26 Jan 2021 13:37:03 -0800 Subject: [PATCH] michael_mcdonald submitting lesson6 practice activity using APIs --- .idea/.gitignore | 3 + .idea/github-latest.iml | 11 ++++ .idea/inspectionProfiles/Project_Default.xml | 57 +++++++++++++++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++ .idea/misc.xml | 4 ++ .idea/modules.xml | 8 +++ .idea/vcs.xml | 6 ++ main.py | 24 +++++--- 8 files changed, 111 insertions(+), 8 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/github-latest.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/github-latest.iml b/.idea/github-latest.iml new file mode 100644 index 0000000..8dc09e5 --- /dev/null +++ b/.idea/github-latest.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..0aa2dd5 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,57 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d1e22ec --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5a0de57 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/main.py b/main.py index f2f1db2..9085f46 100644 --- a/main.py +++ b/main.py @@ -1,20 +1,28 @@ import sys import json - import requests -# Use Like python githubber.py JASchilz -# (or another user name) +# https://api.github.com/ +# https://api.github.com/feeds + + +def get_response(usr): + response = requests.get("https://api.github.com/users/%7B%7D/events".format(username)) + events = json.loads(response.content) + # print(events) + print(events[0]['created_at']) + if __name__ == "__main__": username = sys.argv[1] + # username = 'geekwriter2' + get_response(username) + + + + - # 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")