Skip to content

Instantly share code, notes, and snippets.

@lukeredpath
Created September 14, 2009 10:17
Show Gist options
  • Save lukeredpath/186590 to your computer and use it in GitHub Desktop.
Save lukeredpath/186590 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'uri'
def isgd(url)
`curl http://is.gd/api.php?longurl=#{URI.encode(url)}`
end
def pbcopy(string)
`echo #{string} | pbcopy`
return string
end
if ARGV[0]
puts pbcopy(isgd(ARGV[0]))
else
puts pbcopy(isgd(`pbpaste`.strip))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment