Skip to content

Instantly share code, notes, and snippets.

@dannyOhNo
Last active February 22, 2017 18:06
Show Gist options
  • Save dannyOhNo/405cf395b67c2fa244da45f374655fc1 to your computer and use it in GitHub Desktop.
Save dannyOhNo/405cf395b67c2fa244da45f374655fc1 to your computer and use it in GitHub Desktop.
Github Code Search
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