Created
May 2, 2013 00:38
-
-
Save anonymous/5499428 to your computer and use it in GitHub Desktop.
published from Leo
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
import requests | |
import json | |
tmp = g.os.environ['TEMP'] | |
description = "published from Leo" | |
public = True | |
filename = p.h # node headline | |
content = p.b # node body | |
g.es(filename) | |
print('\n\n--- %s ---' % filename) | |
payload = { | |
'description': description, | |
'public': public, | |
'files': { | |
filename: {'content': content} | |
} | |
} | |
print (payload) | |
r = requests.post('https://api.github.com/gists', data=json.dumps(payload)) | |
print (r.status_code) | |
print (r.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment