chatgpt/pastedb/example_post_controlc.py

16 lines
287 B
Python

import requests
url = "https://controlc.com/api.php?action=save"
# Text to be pasted
text = "Hello, world!"
# Create a new paste
response = requests.post(url, data={"c": text})
# Extract the URL of the newly created paste
paste_url = response.text
print(f"Paste URL: {paste_url}")