Skip to content

Instantly share code, notes, and snippets.

@0xIslamTaha
Last active March 22, 2017 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xIslamTaha/ae871492972cc3e4de475f7384334d6d to your computer and use it in GitHub Desktop.
Save 0xIslamTaha/ae871492972cc3e4de475f7384334d6d to your computer and use it in GitHub Desktop.
pastebin python post text
import requests
USERNAME = ''
PASSWORD = ''
API_DEV_KEY = ''
def get_api_user_key():
global USERNAME, PASSWORD, API_DEV_KEY
data = {'api_dev_key': API_DEV_KEY,
'api_user_name': USERNAME,
'api_user_password': PASSWORD}
responce = requests.post('http://pastebin.com/api/api_login.php', data=data)
return responce.text
def post_text(text):
global API_DEV_KEY
api_user_key = get_api_user_key()
data = {'api_dev_key': API_DEV_KEY, 'api_paste_code': text,
'api_paste_private': b'2', 'api_option': 'paste', 'api_user_key': api_user_key}
responce = requests.post('http://pastebin.com/api/api_post.php', data=data)
if 'http://pastebin.com' in responce.text:
print(' [OK!] ')
print(responce.text)
if __name__ == '__main__':
post_text('Your Text')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment