Skip to content

Instantly share code, notes, and snippets.

@kyanny
Created October 5, 2021 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyanny/a7458ceebaeb4468f4396d704003f652 to your computer and use it in GitHub Desktop.
Save kyanny/a7458ceebaeb4468f4396d704003f652 to your computer and use it in GitHub Desktop.
import urllib.request
import os
import json
token = os.getenv('GITHUB_TOKEN')
headers = {
'Authorization': f'token {token}'
}
url = 'https://api.github.com/user/repos'
req = urllib.request.Request(url, None, headers)
with urllib.request.urlopen(req) as res:
print(res.read().decode('utf8'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment