Last active
March 22, 2017 09:19
-
-
Save 0xIslamTaha/ae871492972cc3e4de475f7384334d6d to your computer and use it in GitHub Desktop.
pastebin python post text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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