Skip to content

Instantly share code, notes, and snippets.

@visnup
Created December 3, 2009 01:47
Show Gist options
  • Save visnup/247822 to your computer and use it in GitHub Desktop.
Save visnup/247822 to your computer and use it in GitHub Desktop.
using pinkyurl
#!/usr/bin/env ruby
require 'open-uri'
require 'rubygems'
require 'rack'
out = nil
query = ARGV.map do |o|
k, v = o.split '='
out = v if k == '--out'
"#{k.sub /^--/, ''}=#{Rack::Utils.escape v}"
end.join('&')
open out, 'w' do |f|
open "http://pinkyurl.com/i?#{query}" do |h|
f.write h.read
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment