import requests
url = 'https://pastebin.com/api/api_post.php'
api_dev_key = '4be8d13d83a5883e5df14b22ca1ec7f5'
code = '''
import requests
u = 'https://snippets.glot.io/snippets'
d = {
"language": "python",
"title": "te464st78545",
"public": True,
"files": [
{
"name": "main12312.py",
"content": "print(424757)"
}
]
}
d1 = {
"description": "nazir",
"public": True,
"files": {
"hello_world.rb": {
"content": "class HelloWorld\n def initialize(name)\n @name = name.capitalize\n end\n def sayHi\n puts \"Hello !\"\n end\nend\n\nhello = HelloWorld.new(\"World\")\nhello.sayHi"
},
"hello_world.py": {
"content": "class HelloWorld:\n\n def __init__(self, name):\n self.name = name.capitalize()\n \n def sayHi(self):\n print \"Hello \" + self.name + \"!\"\n\nhello = HelloWorld(\"world\")\nhello.sayHi()"
},
"hello_world_ruby.txt": {
"content": "Run `ruby hello_world.rb` to print Hello World"
},
"hello_world_python.txt": {
"content": "Run `python hello_world.py` to print Hello World"
}
}
}
r = requests.post(url=u, data=d1)
print(r.url)
print(r.headers['content-type'])
'''
data = {
'api_dev_key': api_dev_key,
'api_option': 'paste',
'api_paste_private': '0',
'api_paste_name': 'gist.py',
'api_paste_format': 'python',
'api_paste_code': code,
# 'api_paste_expire_date' : 'N'
}
r = requests.post(url, data=data)
print(r.text)
import requests
url = 'https://pastebin.com/api/api_post.php'
api_dev_key = '4be8d13d83a5883e5df14b22ca1ec7f5'
code = '''
import requests
u = 'https://snippets.glot.io/snippets'
d = {
"language": "python",
"title": "te464st78545",
"public": True,
"files": [
{
"name": "main12312.py",
"content": "print(424757)"
}
]
}
d1 = {
"description": "nazir",
"public": True,
"files": {
"hello_world.rb": {
"content": "class HelloWorld\n def initialize(name)\n @name = name.capitalize\n end\n def sayHi\n puts \"Hello !\"\n end\nend\n\nhello = HelloWorld.new(\"World\")\nhello.sayHi"
},
"hello_world.py": {
"content": "class HelloWorld:\n\n def __init__(self, name):\n self.name = name.capitalize()\n \n def sayHi(self):\n print \"Hello \" + self.name + \"!\"\n\nhello = HelloWorld(\"world\")\nhello.sayHi()"
},
"hello_world_ruby.txt": {
"content": "Run `ruby hello_world.rb` to print Hello World"
},
"hello_world_python.txt": {
"content": "Run `python hello_world.py` to print Hello World"
}
}
}
r = requests.post(url=u, data=d1)
print(r.url)
print(r.headers['content-type'])
'''
data = {
'api_dev_key': api_dev_key,
'api_option': 'paste',
'api_paste_private': '0',
'api_paste_name': 'gist.py',
'api_paste_format': 'python',
'api_paste_code': code,
# 'api_paste_expire_date' : 'N'
}
r = requests.post(url, data=data)
print(r.text)
import requests
url = 'https://pastebin.com/api/api_post.php'
api_dev_key = '4be8d13d83a5883e5df14b22ca1ec7f5'
code = '''
import requests
u = 'https://snippets.glot.io/snippets'
d = {
"language": "python",
"title": "te464st78545",
"public": True,
"files": [
{
"name": "main12312.py",
"content": "print(424757)"
}
]
}
d1 = {
"description": "nazir",
"public": True,
"files": {
"hello_world.rb": {
"content": "class HelloWorld\n def initialize(name)\n @name = name.capitalize\n end\n def sayHi\n puts \"Hello !\"\n end\nend\n\nhello = HelloWorld.new(\"World\")\nhello.sayHi"
},
"hello_world.py": {
"content": "class HelloWorld:\n\n def __init__(self, name):\n self.name = name.capitalize()\n \n def sayHi(self):\n print \"Hello \" + self.name + \"!\"\n\nhello = HelloWorld(\"world\")\nhello.sayHi()"
},
"hello_world_ruby.txt": {
"content": "Run `ruby hello_world.rb` to print Hello World"
},
"hello_world_python.txt": {
"content": "Run `python hello_world.py` to print Hello World"
}
}
}
r = requests.post(url=u, data=d1)
print(r.url)
print(r.headers['content-type'])
'''
data = {
'api_dev_key': api_dev_key,
'api_option': 'paste',
'api_paste_private': '0',
'api_paste_name': 'gist.py',
'api_paste_format': 'python',
'api_paste_code': code,
# 'api_paste_expire_date' : 'N'
}
r = requests.post(url, data=data)
print(r.text)