Skip to content

Instantly share code, notes, and snippets.

@youpy
Created October 17, 2012 14:06
Show Gist options
  • Save youpy/3905674 to your computer and use it in GitHub Desktop.
Save youpy/3905674 to your computer and use it in GitHub Desktop.
%w(tmpdir netprint prawn).each {|g| require g }
Earthquake.init do
command :netprint do |m|
Dir.mktmpdir do |dir|
filename = dir + "/tweet.pdf"
Prawn::Document.generate(filename) do
font "/Users/youpy/Library/Fonts/M+2P+IPAG.ttf"
text m[1]
end
n = Netprint::Agent.new(ENV['NETPRINT_USERID'], ENV['NETPRINT_PASSWORD'])
n.login
code = n.upload(filename)
input(code)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment