Created
February 6, 2017 04:12
-
-
Save ronaknnathani/507a2730044600a3c80dfa02f2df457c to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env python | |
import requests | |
import logging | |
import time | |
import os | |
import json | |
from requests.auth import HTTPBasicAuth | |
logging.basicConfig(level=logging.DEBUG) | |
start_time = time.time() | |
github_username = os.environ['github_username'] | |
github_access_token = os.environ['github_access_token'] | |
for i in range(50): | |
url = "https://api.github.com/users/{}" | |
response = requests.get(url.format(i+1), auth=HTTPBasicAuth(github_username, github_access_token)) | |
response_dict = json.loads(response.text) | |
print(response_dict['name']) | |
print("--- %s seconds ---" % (time.time() - start_time)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment