Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- def creating_api_user_key(key, name, password):
- api_opt = {
- 'api_dev_key': key,
- 'api_user_name': name.encode('utf-8'),
- 'api_user_password': password.encode('utf-8')
- }
- res = requests.post("https://pastebin.com/api/api_login.php", data=api_opt)
- return res.text
- def post_to_pastebin(dev_key, text, name, user_key):
- api_opt = {
- 'api_dev_key': dev_key,
- 'api_option': 'paste',
- 'api_paste_code': text.encode('utf-8'),
- 'api_paste_name': name.encode('utf-8'),
- 'api_paste_format': 'python',
- 'api_user_key': user_key,
- 'api_paste_private': '0',
- 'api_paste_expire_date': '1D'
- }
- res = requests.post("https://pastebin.com/api/api_post.php", data=api_opt)
- return res.text
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement