mpaste/pastebins/dpaste.py

14 lines
291 B
Python
Raw Normal View History

import requests
def publish_to_dpaste(content):
url = 'https://dpaste.org/api/'
data = {
'content': content,
'format': 'url'
}
response = requests.post(url, data=data)
if response.status_code == 200:
return response.text.strip()
return None