diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2020-07-04 11:54:44 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2020-07-04 11:54:44 -0600 |
commit | 59344b5c59b7190ad3b14a2e8e02db8b5559141b (patch) | |
tree | a8e7ede89d3b896967d7d18d071107bd06c77897 /plugins/cloudapp/cloudapp.rb | |
parent | a3be2e4084285d7625e63bfe4b951c58143e3c9c (diff) | |
parent | a15f0f0e9ff17c1ca5c6d694d732e72c7c03a62b (diff) | |
download | zsh-59344b5c59b7190ad3b14a2e8e02db8b5559141b.tar.gz zsh-59344b5c59b7190ad3b14a2e8e02db8b5559141b.tar.bz2 zsh-59344b5c59b7190ad3b14a2e8e02db8b5559141b.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins/cloudapp/cloudapp.rb')
-rwxr-xr-x | plugins/cloudapp/cloudapp.rb | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/plugins/cloudapp/cloudapp.rb b/plugins/cloudapp/cloudapp.rb deleted file mode 100755 index a11cfdb32..000000000 --- a/plugins/cloudapp/cloudapp.rb +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env ruby -# -# cloudapp -# Zach Holman / @holman -# -# Uploads a file from the command line to CloudApp, drops it into your -# clipboard (on a Mac, at least). -# -# Example: -# -# cloudapp drunk-blake.png -# -# This requires Aaron Russell's cloudapp_api gem: -# -# gem install cloudapp_api -# -# Requires you set your CloudApp credentials in ~/.cloudapp as a simple file of: -# -# email -# password - -require 'rubygems' -begin - require 'cloudapp_api' -rescue LoadError - puts "You need to install cloudapp_api: gem install cloudapp_api" - exit!(1) -end - -config_file = "#{ENV['HOME']}/.cloudapp" -unless File.exist?(config_file) - puts "You need to type your email and password (one per line) into "+ - "`~/.cloudapp`" - exit!(1) -end - -email,password = File.read(config_file).split("\n") - -class HTTParty::Response - # Apparently HTTPOK.ok? IS NOT OKAY WTFFFFFFFFFFUUUUUUUUUUUUUU - # LETS MONKEY PATCH IT I FEEL OKAY ABOUT IT - def ok? ; true end -end - -if ARGV[0].nil? - puts "You need to specify a file to upload." - exit!(1) -end - -CloudApp.authenticate(email,password) -url = CloudApp::Item.create(:upload, {:file => ARGV[0]}).url - -# Say it for good measure. -puts "Uploaded to #{url}." - -# Get the embed link. -url = "#{url}/#{ARGV[0].split('/').last}" - -# Copy it to your (Mac's) clipboard. -`echo '#{url}' | tr -d "\n" | pbcopy` |