14 lines
291 B
Python
14 lines
291 B
Python
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
|
|
|