PasteUrCode

Kod yazarken belirli bir pastebin'e atarız birden fazla amaç için. Kodu açıp kopyala yapıştır yapıp pastebin'e atmak çok uzun sürer. Direkt file parametresine eklenilen dosyası pastebin'e atan ufacık bir script yazdım, belki sizler de kulanırsınız diye paylaşma arzusu duydum.





Evet, 2. görselde scriptin kodunu yazdığım script ile pastebin'e attığım gerçektir. (Tıkla)

Kod:
import requests
import argparse

argparser = argparse.ArgumentParser()
argparser.add_argument('--file', help='File')
args = argparser.parse_args()

f = open(args.file, "rt")
fileread = f.read()




def paste(file):
r = requests.post('https://paste.ubuntu.com/', data = {'poster':'pasted by pasteurcode', 'syntax':'text', 'expiration':'', 'content':fileread}, allow_redirects=False).headers['********']
print("https://paste.ubuntu.com"+r)

paste(fileread)