def post_gist(content, description='', filename='file', auth=False):
 post_data = json.dumps({'description': description, 'public': True, 'files': {filename: {'content': content}}}).encode('utf-8')
 headers = (make_auth_header() if auth else {})
 response = requests.post('https://api.github.com/gists', data=post_data, headers=headers)
 response.raise_for_status()
 response_data = json.loads(response.text)
 return response_data['html_url']

def post_gist ( content , description = '' , filename = 'file' , auth = False ) : post_data = json . dumps ( { 'description' : description , 'public' : True , 'files' : { filename : { 'content' : content } } } ) . encode ( 'utf-8' ) headers = ( make_auth_header ( ) if auth else { } ) response = requests . post ( 'https://api.github.com/gists' , data = post_data , headers = headers ) response . raise_for_status ( ) response_data = json . loads ( response . text ) return response_data [ 'html_url' ]
post some text to a gist .