From ca1a358c0a438389eab031b4f3d146cc78418805 Mon Sep 17 00:00:00 2001 From: mgummel25 Date: Thu, 27 Aug 2020 09:13:54 -0700 Subject: [PATCH 1/2] Create .gitignore --- .gitignore | 132 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..100564d --- /dev/null +++ b/.gitignore @@ -0,0 +1,132 @@ +__pycache__/ +.idea/ +my_database.db +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ From 5a50e5f142fc9f8f13dfbf2799cf1cd8ffb25dca Mon Sep 17 00:00:00 2001 From: "matt.gummel" Date: Thu, 27 Aug 2020 09:39:49 -0700 Subject: [PATCH 2/2] finished lesson06 activity --- main.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/main.py b/main.py index f2f1db2..203b472 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,4 @@ import sys -import json import requests @@ -8,13 +7,7 @@ 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") - - - + user_info = requests.get(url=f"https://api.github.com/users/{username}").json() + events_url = user_info['events_url'].strip("{/privacy}") + events = requests.get(url=events_url).json() + print(events[0]["created_at"])