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
[ | |
{ | |
"client_id": "398oijosdi883798798sd", | |
"name": "PokitDok Test App", | |
"html_url": "https://github.com/pokitdok/pokitdok-csharp/blob/master/example/ConsoleApplication1/Program.cs" | |
} | |
] |
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
detected_apps = [] | |
for app in apps: | |
client_id = app.get('client_id') | |
name = app.get('name') | |
result_raw = make_request(client_id) | |
if result_raw.status_code == 200: | |
html_url = parse_response(result_raw.text) | |
if html_url: |
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') |
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
GET /search/code |