Created
November 25, 2016 15:35
-
-
Save fstamour/f0da19b3195aad2ea2058f9235d8d5d3 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python3 | |
import sys | |
import http.client | |
import json | |
if __name__ == '__main__': | |
if len(sys.argv) < 2: | |
print("USAGE: gist.py gist-id") | |
sys.exit(1) | |
gist_id = sys.argv[1] | |
conn = http.client.HTTPSConnection('api.github.com') | |
conn.request('GET', '/gists/' + gist_id, headers={'User-Agent': 'gist.py'}) | |
response = conn.getresponse().read().decode() | |
print(json.loads(responseresponse.read().decode())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment