All pastes #339740 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-02-04 08:02 UTC
rendered paste body
#!/usr/bin/rubyrequire 'rubygems'require 'net/http'require 'hpricot'class PasteBin	def initialize(file)		@file = file	end	def getCode		@code = File.read(@file)	end	def sendCode		data = {			'content' => @code,			'description' => '',			'type' => '1',			'expiry' => '',			'name' => '',			's' => 'Submit Post'		}		@response = Net::HTTP.post_form(URI.parse('http://pastebin.ca/new.php'), data)	end	def getLink		puts @response.body	endendpaste = PasteBin.new(ARGV[0])paste.getCodepaste.sendCodepaste.getLink