• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Ruby [Ruby] PasteBin Uploader

Status
Not open for further replies.

Doddy

Leech
User
Joined
Apr 1, 2012
Messages
169
Reputation
0
Reaction score
406
Points
63
Credits
0
‎13 Years of Service‎
57%
Un simple programa para subir codigos a pastebin

Code:
>
#!usr/bin/ruby
#PasteBin Uploader  (C) Doddy Hackman 2011

require "net/http"

def head()
print "\n\n-- == PasteBin Uploader\n\n\n"
end

def copyright()
print "\n\n(C) Doddy Hackman 2011\n\n"
exit(1)
end

def uso()
print "\n[+] up.rb   \n"
end

def tomar(web,par)
  return Net::HTTP.post_form(URI.parse(web),par).body
  end

def subir(file,titulo,tipo)

begin
archivo = File.open(file)
lineas = archivo.readlines
rescue
print "\n[-] Error open file\n" 
end

print "[+] Uploading file\n\n"

code = tomar("http://pastebin.com/api_public.php",{"paste_code" =>lineas,"paste_name"=>titulo,"paste_format"=>tipo,"paste_expire_date"=>"N","paste_private"=>"public","submit"=>"submit"})

if code=~/Bad API request/
print "[-] Error uploading\n"
else
print "[+] Enjoy : "+code+"\n"

end
end

file = ARGV[0]
titulo = ARGV[1]
tipo = ARGV[2]

head()
if !file and !titulo and !tipo
uso()
else
subir(file,titulo,tipo)
end
copyright()

# ¿ The End ?
 
Status
Not open for further replies.
Back
Top