Last active
February 22, 2017 18:06
-
-
Save dannyOhNo/405cf395b67c2fa244da45f374655fc1 to your computer and use it in GitHub Desktop.
Github Code Search
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_request(client_id): | |
result_raw = requests.get( | |
'https://api.github.com/search/code?q={0}'.format(client_id), | |
headers={"Authorization": "token {}".format(GITHUB_PERSONAL_ACCESS_TOKEN)} | |
) | |
return result_raw | |
def parse_response(text): | |
result = json.loads(text) | |
html_url = result.get('items')[0].get('html_url') | |
return html_url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment