Skip to content

Instantly share code, notes, and snippets.

Created May 2, 2013 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5499428 to your computer and use it in GitHub Desktop.
Save anonymous/5499428 to your computer and use it in GitHub Desktop.
published from Leo
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