cloudapp 1.1.0 → 2.0.0.beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +18 -34
- data/README.md +2 -1
- data/Rakefile +5 -1
- data/cloudapp.gemspec +50 -41
- data/lib/cloudapp/account.rb +111 -0
- data/lib/cloudapp/authorized_representation.rb +17 -0
- data/lib/cloudapp/collection_json/item.rb +20 -0
- data/lib/cloudapp/collection_json/representation.rb +74 -0
- data/lib/cloudapp/collection_json/template.rb +17 -0
- data/lib/cloudapp/collection_json/tint.rb +11 -0
- data/lib/cloudapp/collection_json.rb +3 -0
- data/lib/cloudapp/drop.rb +22 -6
- data/lib/cloudapp/drop_collection.rb +22 -0
- data/lib/cloudapp/service.rb +172 -0
- data/lib/cloudapp/token.rb +27 -0
- data/lib/cloudapp.rb +5 -1
- data/man/cloudapp.1 +202 -45
- data/man/cloudapp.1.html +114 -42
- data/man/cloudapp.1.ronn +125 -45
- data/spec/cassettes/create_bookmark.yml +255 -0
- data/spec/cassettes/create_bookmark_with_name.yml +266 -0
- data/spec/cassettes/create_bookmark_with_privacy.yml +277 -0
- data/spec/cassettes/delete_drop.yml +383 -0
- data/spec/cassettes/list_drops.yml +139 -0
- data/spec/cassettes/list_drops_with_bad_token.yml +57 -0
- data/spec/cassettes/list_drops_with_filter.yml +209 -0
- data/spec/cassettes/list_drops_with_href.yml +287 -0
- data/spec/cassettes/list_drops_with_href_and_filter.yml +287 -0
- data/spec/cassettes/list_drops_with_href_and_limit.yml +287 -0
- data/spec/cassettes/list_drops_with_limit.yml +211 -0
- data/spec/cassettes/list_drops_with_nil_href.yml +139 -0
- data/spec/cassettes/purge_drops.yml +1103 -0
- data/spec/cassettes/recover_drop.yml +628 -0
- data/spec/cassettes/rename_drop.yml +367 -0
- data/spec/cassettes/setup_drops.yml +968 -0
- data/spec/cassettes/token_for_account.yml +127 -0
- data/spec/cassettes/token_for_account_with_bad_credentials.yml +115 -0
- data/spec/cassettes/trash_drop.yml +478 -0
- data/spec/cassettes/update_drop_bookmark_url.yml +379 -0
- data/spec/cassettes/update_file.yml +573 -0
- data/spec/cassettes/upload_file.yml +470 -0
- data/spec/cassettes/upload_file_with_name.yml +484 -0
- data/spec/cassettes/upload_file_with_privacy.yml +495 -0
- data/spec/cassettes/view_drop.yml +73 -0
- data/spec/cloudapp/account_spec.rb +166 -0
- data/spec/cloudapp/authorized_representation_spec.rb +32 -0
- data/spec/cloudapp/collection_json/item_spec.rb +45 -0
- data/spec/cloudapp/collection_json/representation_spec.rb +118 -0
- data/spec/cloudapp/collection_json/template_spec.rb +53 -0
- data/spec/cloudapp/drop_collection_spec.rb +63 -0
- data/spec/cloudapp/drop_spec.rb +81 -51
- data/spec/cloudapp/service_spec.rb +357 -0
- data/spec/cloudapp/token_spec.rb +33 -0
- data/spec/integration_spec.rb +100 -0
- data/spec/support/stub_class_or_module.rb +6 -3
- data/spec/support/vcr.rb +21 -5
- metadata +84 -106
- data/bin/cloudapp +0 -184
- data/lib/cloudapp/config.rb +0 -39
- data/lib/cloudapp/drop_content.rb +0 -34
- data/lib/cloudapp/drop_presenter.rb +0 -80
- data/lib/cloudapp/drop_service.rb +0 -255
- data/lib/cloudapp/identity.rb +0 -14
- data/spec/cassettes/DropContent/download.yml +0 -116
- data/spec/cassettes/DropService/create_bookmark.yml +0 -105
- data/spec/cassettes/DropService/create_bookmark_with_bad_credentials.yml +0 -39
- data/spec/cassettes/DropService/create_bookmark_with_name.yml +0 -105
- data/spec/cassettes/DropService/create_private_bookmark.yml +0 -105
- data/spec/cassettes/DropService/create_public_bookmark.yml +0 -105
- data/spec/cassettes/DropService/drop.yml +0 -81
- data/spec/cassettes/DropService/list_drops.yml +0 -135
- data/spec/cassettes/DropService/list_drops_with_bad_credentials.yml +0 -39
- data/spec/cassettes/DropService/list_drops_with_limit.yml +0 -117
- data/spec/cassettes/DropService/list_trash.yml +0 -111
- data/spec/cassettes/DropService/list_trash_with_bad_credentials.yml +0 -39
- data/spec/cassettes/DropService/retrieve_token.yml +0 -42
- data/spec/cassettes/DropService/retrieve_token_with_bad_credentials.yml +0 -43
- data/spec/cassettes/DropService/upload_file.yml +0 -291
- data/spec/cassettes/DropService/upload_public_file.yml +0 -293
- data/spec/cloudapp/config_spec.rb +0 -59
- data/spec/cloudapp/drop_content_spec.rb +0 -21
- data/spec/cloudapp/drop_presenter_spec.rb +0 -120
- data/spec/cloudapp/drop_service_spec.rb +0 -400
- data/spec/cloudapp/identity_spec.rb +0 -27
- data/spec/support/fakefs_rspec.rb +0 -5
- data/spec/support/vcr_rspec.rb +0 -9
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
require 'leadlight'
|
|
2
|
+
require 'typhoeus'
|
|
3
|
+
require 'cloudapp/authorized_representation'
|
|
4
|
+
require 'cloudapp/collection_json'
|
|
5
|
+
require 'cloudapp/collection_json/tint'
|
|
6
|
+
|
|
7
|
+
module CloudApp
|
|
8
|
+
class Service
|
|
9
|
+
Leadlight.build_service(self) do
|
|
10
|
+
url 'https://api.getcloudapp.com'
|
|
11
|
+
tints << CollectionJson::Tint
|
|
12
|
+
tints << AuthorizedRepresentation::Tint
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
Leadlight.build_connection_common do |builder|
|
|
16
|
+
builder.adapter :typhoeus
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def initialize
|
|
20
|
+
super
|
|
21
|
+
logger.level = Logger::WARN
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def token=(token)
|
|
25
|
+
connection.token_auth token
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def self.using_token(token)
|
|
29
|
+
new.tap do |service|
|
|
30
|
+
service.token = token
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def token_for_account(email, password)
|
|
35
|
+
authenticate_response = root
|
|
36
|
+
data = authenticate_response.template.
|
|
37
|
+
fill('email' => email, 'password' => password)
|
|
38
|
+
|
|
39
|
+
post(authenticate_response.href, {}, data) do |response|
|
|
40
|
+
return response
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def drops(options = {})
|
|
45
|
+
href = options[:href] || :root
|
|
46
|
+
params = options.has_key?(:href) ? {} : options
|
|
47
|
+
|
|
48
|
+
drops_at href, params
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def drop_at(href)
|
|
52
|
+
drops_at href
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def update(href, options = {})
|
|
56
|
+
collection = drops_at href
|
|
57
|
+
drop = collection.items.first
|
|
58
|
+
path = options.fetch :path, nil
|
|
59
|
+
attributes = drop.data.merge fetch_drop_attributes(options)
|
|
60
|
+
data = collection.template.fill attributes
|
|
61
|
+
|
|
62
|
+
put(drop.href, {}, data) do |collection|
|
|
63
|
+
if not path
|
|
64
|
+
return collection
|
|
65
|
+
else
|
|
66
|
+
return upload_file(path, collection)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def bookmark(url, options = {})
|
|
72
|
+
attributes = fetch_drop_attributes options.merge(url: url)
|
|
73
|
+
collection = drops_at :root
|
|
74
|
+
data = collection.template.fill(attributes)
|
|
75
|
+
|
|
76
|
+
post(collection.href, {}, data) do |response|
|
|
77
|
+
return response
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def upload(path, options = {})
|
|
82
|
+
attributes = fetch_drop_attributes options.merge(path: path)
|
|
83
|
+
collection = drops_at :root
|
|
84
|
+
data = collection.template.fill(attributes)
|
|
85
|
+
|
|
86
|
+
post(collection.href, {}, data) do |collection|
|
|
87
|
+
return upload_file(path, collection)
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def trash_drop(href)
|
|
92
|
+
update href, trash: true
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def recover_drop(href)
|
|
96
|
+
update href, trash: false
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def delete_drop(href)
|
|
100
|
+
delete(href) do |response|
|
|
101
|
+
return response
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
private
|
|
106
|
+
|
|
107
|
+
def drops_at(href, params = {})
|
|
108
|
+
params = params.each_with_object({}) {|(key, value), params|
|
|
109
|
+
params[key.to_s] = value
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if href == :root
|
|
113
|
+
get('/') do |response|
|
|
114
|
+
return response if response.__response__.status == 401
|
|
115
|
+
href = response.link('drops').href
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
get(href) do |response|
|
|
120
|
+
return response if response.__response__.status == 401
|
|
121
|
+
if not params.empty?
|
|
122
|
+
drops_query = response.query('drops-list')
|
|
123
|
+
href = drops_query.href
|
|
124
|
+
params = drops_query.fill(params)
|
|
125
|
+
else
|
|
126
|
+
return response
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
get(href, params) do |response|
|
|
131
|
+
return response if response.__response__.status == 401
|
|
132
|
+
return response
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def fetch_drop_attributes(options)
|
|
137
|
+
path = options.delete :path
|
|
138
|
+
options[:file_size] = FileTest.size(path) if path
|
|
139
|
+
{ url: 'bookmark_url',
|
|
140
|
+
file_size: 'file_size',
|
|
141
|
+
name: 'name',
|
|
142
|
+
private: 'private',
|
|
143
|
+
trash: 'trash'
|
|
144
|
+
}.each_with_object({}) {|(key, name), attributes|
|
|
145
|
+
attributes[name] = options.fetch(key) if options.has_key?(key)
|
|
146
|
+
}
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
def upload_file(path, collection)
|
|
150
|
+
uri = Addressable::URI.parse collection.href
|
|
151
|
+
file = File.open path
|
|
152
|
+
file_io = Faraday::UploadIO.new file, 'image/png'
|
|
153
|
+
fields = collection.template.fill('file' => file_io)
|
|
154
|
+
|
|
155
|
+
conn = Faraday.new(url: uri.site) {|builder|
|
|
156
|
+
if collection.template.enctype == Faraday::Request::Multipart.mime_type
|
|
157
|
+
builder.request :multipart
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
builder.response :logger, logger
|
|
161
|
+
builder.adapter :typhoeus
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
conn.post(uri.request_uri, fields).on_complete do |env|
|
|
165
|
+
location = Addressable::URI.parse env[:response_headers]['Location']
|
|
166
|
+
get(location) do |upload_response|
|
|
167
|
+
return upload_response
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Usage:
|
|
2
|
+
#
|
|
3
|
+
# # Retrieve an account's token
|
|
4
|
+
# token = CloudApp::Token.for_account 'arthur@dent.com', 'towel'
|
|
5
|
+
#
|
|
6
|
+
module CloudApp
|
|
7
|
+
class Token
|
|
8
|
+
class << self
|
|
9
|
+
attr_writer :service_source
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.service_source
|
|
13
|
+
@service_source ||= CloudApp::Service.public_method(:new)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def self.service
|
|
17
|
+
service_source.call
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.for_account(email, password)
|
|
21
|
+
representation = service.token_for_account email, password
|
|
22
|
+
return if representation.unauthorized?
|
|
23
|
+
|
|
24
|
+
representation.items.first.data['token']
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
data/lib/cloudapp.rb
CHANGED
data/man/cloudapp.1
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
|
3
3
|
.
|
|
4
|
-
.TH "CLOUDAPP" "1" "
|
|
4
|
+
.TH "CLOUDAPP" "1" "May 2012" "" ""
|
|
5
5
|
.
|
|
6
6
|
.SH "NAME"
|
|
7
7
|
\fBcloudapp\fR \- All the pleasures of CloudApp now at your terminal
|
|
8
8
|
.
|
|
9
9
|
.SH "SYNOPSIS"
|
|
10
|
-
\fBcloudapp\fR [\
|
|
10
|
+
\fBcloudapp\fR [\fIglobal\fR] \fBlist\fR [\fIoptions\fR]
|
|
11
11
|
.
|
|
12
12
|
.br
|
|
13
|
-
\fBcloudapp
|
|
13
|
+
\fBcloudapp\fR [\fIglobal\fR] \fBdetails\fR \fIhref\fR [\fIhref\fR\.\.\.]
|
|
14
14
|
.
|
|
15
15
|
.br
|
|
16
|
-
\fBcloudapp
|
|
16
|
+
\fBcloudapp\fR [\fIglobal\fR] \fBbookmark\fR [\fIoptions\fR] \fIurl\fR [\fIurl\fR\.\.\.]
|
|
17
17
|
.
|
|
18
18
|
.br
|
|
19
|
-
\fBcloudapp
|
|
19
|
+
\fBcloudapp\fR [\fIglobal\fR] \fBupload\fR [\fIoptions\fR] \fIfile\fR [\fIfile\fR\.\.\.]
|
|
20
20
|
.
|
|
21
21
|
.br
|
|
22
|
-
\fBcloudapp
|
|
22
|
+
\fBcloudapp\fR [\fIglobal\fR] \fBupdate\fR [\fIoptions\fR] \fIhref\fR [\fIhref\fR\.\.\.]
|
|
23
|
+
.
|
|
24
|
+
.br
|
|
25
|
+
\fBcloudapp\fR [\fIglobal\fR] \fBtrash\fR \fIhref\fR [\fIhref\fR\.\.\.]
|
|
26
|
+
.
|
|
27
|
+
.br
|
|
28
|
+
\fBcloudapp\fR [\fIglobal\fR] \fBrecover\fR \fIhref\fR [\fIhref\fR\.\.\.]
|
|
29
|
+
.
|
|
30
|
+
.br
|
|
31
|
+
\fBcloudapp\fR [\fIglobal\fR] \fBdelete\fR \fIhref\fR [\fIhref\fR\.\.\.]
|
|
23
32
|
.
|
|
24
33
|
.SH "DESCRIPTION"
|
|
25
34
|
\fBcloudapp\fR is a simple, Unix\-friendly tool for CloudApp meant to augment the Mac and Web apps\. Sometimes it\'s more convenient to share without leaving the terminal and other times it\'s the only tool available\.
|
|
@@ -27,63 +36,95 @@
|
|
|
27
36
|
.SH "GLOBAL OPTIONS"
|
|
28
37
|
.
|
|
29
38
|
.TP
|
|
30
|
-
\fB\-f\fR \
|
|
39
|
+
\fB\-f\fR \fIpretty,csv\fR, \fB\-\-format\fR=\fIpretty,csv\fR
|
|
31
40
|
Output using either \fBpretty\fR or \fBcsv\fR format\. (Default: \fBpretty\fR when output to a terminal and \fBcsv\fR when output is piped to another program\.)
|
|
32
41
|
.
|
|
33
42
|
.SH "COMMANDS"
|
|
34
43
|
.
|
|
35
44
|
.TP
|
|
36
|
-
\
|
|
37
|
-
|
|
45
|
+
\fB\-\-bookmark\fR=\fIurl\fR
|
|
46
|
+
Update the drop converting it into a bookmark to \fIurl\fR\.
|
|
47
|
+
.
|
|
48
|
+
.TP
|
|
49
|
+
\fBbookmark\fR [\fB\-\-private\fR] [\fB\-\-public\fR] \fIurl\fR [\fIurl\fR\.\.\.]
|
|
50
|
+
Create a new bookmark to each \fIurl\fR and print the share links\.
|
|
51
|
+
.
|
|
52
|
+
.TP
|
|
53
|
+
\fBdelete\fR \fIhref\fR [\fIhref\fR\.\.\.]
|
|
54
|
+
Delete each drop at \fIhref\fR immediately and bypass the trash\.
|
|
55
|
+
.
|
|
56
|
+
.TP
|
|
57
|
+
\fBdetails\fR \fIhref\fR [\fIhref\fR\.\.\.]
|
|
58
|
+
View the details of each drop at \fIhref\fR\.
|
|
59
|
+
.
|
|
60
|
+
.TP
|
|
61
|
+
\fBlist\fR, \fBls\fR [\fB\-\-count\fR=\fIcount\fR] [\fB\-\-filter\fR=\fIactive,trash,all\fR]
|
|
62
|
+
List the newest \fIcount\fR of \fIfilter\fR drops\. The default is to list \fB20 active\fR drops\.
|
|
63
|
+
.
|
|
64
|
+
.TP
|
|
65
|
+
\fBrecover\fR \fIhref\fR [\fIhref\fR\.\.\.]
|
|
66
|
+
Recover each drop at \fIhref\fR from the trash\.
|
|
38
67
|
.
|
|
39
68
|
.TP
|
|
40
|
-
\
|
|
41
|
-
|
|
69
|
+
\fBtrash\fR \fIhref\fR [\fIhref\fR\.\.\.]
|
|
70
|
+
Send each drop at \fIhref\fR to the trash\.
|
|
42
71
|
.
|
|
43
72
|
.TP
|
|
44
|
-
\
|
|
45
|
-
|
|
73
|
+
\fBupdate\fR [\fB\-\-name\fR=\fIname\fR] [\fB\-\-private\fR] [\fB\-\-public\fR] [\fB\-\-bookmark\fR=\fIurl\fR] [\fB\-\-file\fR=\fIfile\fR] \fIhref\fR [\fIhref\fR\.\.\.]
|
|
74
|
+
Update the name, privacy, bookmark link, or file of each drop at \fIhref\fR\.
|
|
46
75
|
.
|
|
47
76
|
.TP
|
|
48
77
|
\fBupload\fR [\fB\-\-private\fR] [\fB\-\-public\fR] \fIfile\fR [\fIfile\fR\.\.\.]
|
|
49
|
-
Upload each \fIfile\fR and print
|
|
78
|
+
Upload each \fIfile\fR and print the share links\.
|
|
50
79
|
.
|
|
51
80
|
.SH "COMMAND OPTIONS"
|
|
52
81
|
.
|
|
53
82
|
.TP
|
|
83
|
+
\fB\-\-bookmark\fR=\fIurl\fR
|
|
84
|
+
Update the drop converting it into a bookmark to \fIurl\fR\.
|
|
85
|
+
.
|
|
86
|
+
.TP
|
|
87
|
+
\fB\-\-file\fR=\fIfile\fR
|
|
88
|
+
Update the drop converting it into a file and replacing its content with \fIfile\fR\.
|
|
89
|
+
.
|
|
90
|
+
.TP
|
|
91
|
+
\fB\-\-filter\fR=\fIactive,trash,all\fR
|
|
92
|
+
Show \fIfilter\fR drops\. (Default: \fBactive\fR)
|
|
93
|
+
.
|
|
94
|
+
.TP
|
|
54
95
|
\fB\-n\fR \fIcount\fR, \fB\-\-count\fR=\fIcount\fR
|
|
55
96
|
Display \fIcount\fR drops\. (Default: \fB20\fR)
|
|
56
97
|
.
|
|
57
98
|
.TP
|
|
58
|
-
\fB
|
|
59
|
-
|
|
99
|
+
\fB\-\-name\fR=\fIname\fR
|
|
100
|
+
Update the drop\'s name to \fIname\fR\.
|
|
60
101
|
.
|
|
61
102
|
.TP
|
|
62
103
|
\fB\-\-private\fR
|
|
63
|
-
Use a private (long) link
|
|
104
|
+
Use a private (long) link for the drop\.
|
|
64
105
|
.
|
|
65
106
|
.TP
|
|
66
107
|
\fB\-\-public\fR
|
|
67
|
-
Use a public (short) link
|
|
108
|
+
Use a public (short) link for the drop\.
|
|
68
109
|
.
|
|
69
110
|
.SH "REQUIREMENTS"
|
|
70
111
|
\fBcloudapp\fR requires Ruby 1\.9\.2 or greater\.
|
|
71
112
|
.
|
|
72
113
|
.SH "EXAMPLES"
|
|
73
|
-
List newest
|
|
114
|
+
List the newest drops:
|
|
74
115
|
.
|
|
75
116
|
.IP "" 4
|
|
76
117
|
.
|
|
77
118
|
.nf
|
|
78
119
|
|
|
79
120
|
$ cloudapp list
|
|
80
|
-
Name
|
|
81
|
-
favicon\.ico http://
|
|
82
|
-
The Hitchhiker\'s Guide http://
|
|
83
|
-
CloudApp 1\.5 Released http://
|
|
84
|
-
Cover\.jpeg http://
|
|
85
|
-
Chapter 1\.md http://
|
|
86
|
-
CloudApp http://
|
|
121
|
+
Name Views Href
|
|
122
|
+
favicon\.ico 1 http://api\.getcloudapp\.com/\.\.\.
|
|
123
|
+
The Hitchhiker\'s Guide 0 http://api\.getcloudapp\.com/\.\.\.
|
|
124
|
+
CloudApp 1\.5 Released 5 http://api\.getcloudapp\.com/\.\.\.
|
|
125
|
+
Cover\.jpeg 23 http://api\.getcloudapp\.com/\.\.\.
|
|
126
|
+
Chapter 1\.md 8 http://api\.getcloudapp\.com/\.\.\.
|
|
127
|
+
CloudApp 3 http://api\.getcloudapp\.com/\.\.\.
|
|
87
128
|
\.\.\.
|
|
88
129
|
.
|
|
89
130
|
.fi
|
|
@@ -91,19 +132,35 @@ CloudApp http://cl\.ly/2O2J\.\.\. 3
|
|
|
91
132
|
.IP "" 0
|
|
92
133
|
.
|
|
93
134
|
.P
|
|
94
|
-
List
|
|
135
|
+
List the 5 newest drops:
|
|
95
136
|
.
|
|
96
137
|
.IP "" 4
|
|
97
138
|
.
|
|
98
139
|
.nf
|
|
99
140
|
|
|
100
141
|
$ cloudapp list \-\-count=5
|
|
101
|
-
Name
|
|
102
|
-
favicon\.ico http://
|
|
103
|
-
The Hitchhiker\'s Guide http://
|
|
104
|
-
CloudApp 1\.5 Released http://
|
|
105
|
-
Cover\.jpeg http://
|
|
106
|
-
Chapter 1\.md http://
|
|
142
|
+
Name Views Href
|
|
143
|
+
favicon\.ico 1 http://api\.getcloudapp\.com/\.\.\.
|
|
144
|
+
The Hitchhiker\'s Guide 0 http://api\.getcloudapp\.com/\.\.\.
|
|
145
|
+
CloudApp 1\.5 Released 5 http://api\.getcloudapp\.com/\.\.\.
|
|
146
|
+
Cover\.jpeg 23 http://api\.getcloudapp\.com/\.\.\.
|
|
147
|
+
Chapter 1\.md 8 http://api\.getcloudapp\.com/\.\.\.
|
|
148
|
+
.
|
|
149
|
+
.fi
|
|
150
|
+
.
|
|
151
|
+
.IP "" 0
|
|
152
|
+
.
|
|
153
|
+
.P
|
|
154
|
+
List newest, deleted drops:
|
|
155
|
+
.
|
|
156
|
+
.IP "" 4
|
|
157
|
+
.
|
|
158
|
+
.nf
|
|
159
|
+
|
|
160
|
+
$ cloudapp list \-\-filter=trash
|
|
161
|
+
Name Views Href
|
|
162
|
+
Delete Me 0 http://api\.getcloudapp\.com/\.\.\.
|
|
163
|
+
\.\.\.
|
|
107
164
|
.
|
|
108
165
|
.fi
|
|
109
166
|
.
|
|
@@ -117,12 +174,50 @@ List newest 5 drops in CSV format:
|
|
|
117
174
|
.nf
|
|
118
175
|
|
|
119
176
|
$ cloudapp \-\-format=csv list \-\-count=5
|
|
120
|
-
Name,
|
|
121
|
-
favicon\.ico,http://cl\.ly/0P28\.\.\.,3
|
|
122
|
-
The Hitchhiker\'s Guide to the Galaxy,http://cl\.ly/3I28\.\.\.,4
|
|
123
|
-
2011\-05\-03\-cloudapp\-1\.5\-released\.md,http://cl\.ly/0s1o\.\.\.,4
|
|
124
|
-
Cover\.jpeg,http://cl\.ly/1x20\.\.\.,1
|
|
125
|
-
Chapter 1\.md,http://cl\.ly/3U3d\.\.\.,7
|
|
177
|
+
Name,Href,Share,Views
|
|
178
|
+
favicon\.ico,http://api\.getcloudapp\.com/\.\.\.,http://cl\.ly/0P28\.\.\.,3
|
|
179
|
+
The Hitchhiker\'s Guide to the Galaxy,http://api\.getcloudapp\.com/\.\.\.,http://cl\.ly/3I28\.\.\.,4
|
|
180
|
+
2011\-05\-03\-cloudapp\-1\.5\-released\.md,http://api\.getcloudapp\.com/\.\.\.,http://cl\.ly/0s1o\.\.\.,4
|
|
181
|
+
Cover\.jpeg,http://api\.getcloudapp\.com/\.\.\.,http://cl\.ly/1x20\.\.\.,1
|
|
182
|
+
Chapter 1\.md,http://api\.getcloudapp\.com/\.\.\.,http://cl\.ly/3U3d\.\.\.,7
|
|
183
|
+
.
|
|
184
|
+
.fi
|
|
185
|
+
.
|
|
186
|
+
.IP "" 0
|
|
187
|
+
.
|
|
188
|
+
.P
|
|
189
|
+
View the details of a drop by its \fBhref\fR:
|
|
190
|
+
.
|
|
191
|
+
.IP "" 4
|
|
192
|
+
.
|
|
193
|
+
.nf
|
|
194
|
+
|
|
195
|
+
$ cloudapp details http://api\.getcloudapp\.com/drops/12345
|
|
196
|
+
Details
|
|
197
|
+
Name: Cover\.jpeg
|
|
198
|
+
Views: 23
|
|
199
|
+
Privacy: Private
|
|
200
|
+
|
|
201
|
+
Links
|
|
202
|
+
Share: http://cl\.ly/1x200A0m3v101d1n2O1u
|
|
203
|
+
Embed: http://cl\.ly/1x200A0m3v101d1n2O1u/Cover\.jpeg
|
|
204
|
+
Download: http://cl\.ly/1x200A0m3v101d1n2O1u/download/Cover\.jpeg
|
|
205
|
+
Href: http://api\.getcloudapp\.com/drops/13949858
|
|
206
|
+
.
|
|
207
|
+
.fi
|
|
208
|
+
.
|
|
209
|
+
.IP "" 0
|
|
210
|
+
.
|
|
211
|
+
.P
|
|
212
|
+
View the details of a drop in CSV format:
|
|
213
|
+
.
|
|
214
|
+
.IP "" 4
|
|
215
|
+
.
|
|
216
|
+
.nf
|
|
217
|
+
|
|
218
|
+
$ cloudapp \-\-format=csv details http://api\.getcloudapp\.com/drops/12345
|
|
219
|
+
Name,Created,Privacy,Share,Embed,Download
|
|
220
|
+
Cover\.jpg,2012\-01\-12T20:44:58Z,private,http://cl\.ly/1x20\.\.\.,http://cl\.ly/1x20\.\.\.,http://cl\.ly/1x20\.\.\.
|
|
126
221
|
.
|
|
127
222
|
.fi
|
|
128
223
|
.
|
|
@@ -185,28 +280,90 @@ http://cl\.ly/1y0j403g3D0c0X1G0R3m
|
|
|
185
280
|
.IP "" 0
|
|
186
281
|
.
|
|
187
282
|
.P
|
|
188
|
-
|
|
283
|
+
Update a drop with a new name and privacy:
|
|
284
|
+
.
|
|
285
|
+
.IP "" 4
|
|
286
|
+
.
|
|
287
|
+
.nf
|
|
288
|
+
|
|
289
|
+
$ cloudapp update \-\-public \e
|
|
290
|
+
\-\-name=\'The Late, Great Douglas Adams\' \e
|
|
291
|
+
http://api\.getcloudapp\.com/drops/12345
|
|
292
|
+
Updating\.\.\. http://cl\.ly/abc123
|
|
293
|
+
.
|
|
294
|
+
.fi
|
|
295
|
+
.
|
|
296
|
+
.IP "" 0
|
|
297
|
+
.
|
|
298
|
+
.P
|
|
299
|
+
Update a drop with a new bookmark URL:
|
|
300
|
+
.
|
|
301
|
+
.IP "" 4
|
|
302
|
+
.
|
|
303
|
+
.nf
|
|
304
|
+
|
|
305
|
+
$ cloudapp update \-\-bookmark=http://douglasadams\.com \e
|
|
306
|
+
http://api\.getcloudapp\.com/drops/12345
|
|
307
|
+
Updating\.\.\. http://cl\.ly/1y0j403g3D0c0X1G0R3m
|
|
308
|
+
.
|
|
309
|
+
.fi
|
|
310
|
+
.
|
|
311
|
+
.IP "" 0
|
|
312
|
+
.
|
|
313
|
+
.P
|
|
314
|
+
Update a drop with a new file:
|
|
315
|
+
.
|
|
316
|
+
.IP "" 4
|
|
317
|
+
.
|
|
318
|
+
.nf
|
|
319
|
+
|
|
320
|
+
$ cloudapp update \-\-file=screenshot\.png \e
|
|
321
|
+
http://api\.getcloudapp\.com/drops/12345
|
|
322
|
+
Updating\.\.\. http://cl\.ly/1y0j403g3D0c0X1G0R3m
|
|
323
|
+
.
|
|
324
|
+
.fi
|
|
325
|
+
.
|
|
326
|
+
.IP "" 0
|
|
327
|
+
.
|
|
328
|
+
.P
|
|
329
|
+
Trash a drop:
|
|
330
|
+
.
|
|
331
|
+
.IP "" 4
|
|
332
|
+
.
|
|
333
|
+
.nf
|
|
334
|
+
|
|
335
|
+
$ cloudapp trash http://api\.getcloudapp\.com/drops/12345
|
|
336
|
+
Trashing http://api\.getcloudapp\.dev/drops/12345\.\.\. done
|
|
337
|
+
.
|
|
338
|
+
.fi
|
|
339
|
+
.
|
|
340
|
+
.IP "" 0
|
|
341
|
+
.
|
|
342
|
+
.P
|
|
343
|
+
Recovering a drop:
|
|
189
344
|
.
|
|
190
345
|
.IP "" 4
|
|
191
346
|
.
|
|
192
347
|
.nf
|
|
193
348
|
|
|
194
|
-
$ cloudapp
|
|
195
|
-
|
|
349
|
+
$ cloudapp recover http://api\.getcloudapp\.com/drops/12345
|
|
350
|
+
Recovering http://api\.getcloudapp\.dev/drops/12345\.\.\. http://cl\.ly/1y0j\.\.\.
|
|
196
351
|
.
|
|
197
352
|
.fi
|
|
198
353
|
.
|
|
199
354
|
.IP "" 0
|
|
200
355
|
.
|
|
201
356
|
.P
|
|
202
|
-
|
|
357
|
+
Deleting a drop:
|
|
203
358
|
.
|
|
204
359
|
.IP "" 4
|
|
205
360
|
.
|
|
206
361
|
.nf
|
|
207
362
|
|
|
208
|
-
$ cloudapp
|
|
209
|
-
|
|
363
|
+
$ cloudapp trash http://api\.getcloudapp\.com/drops/12345
|
|
364
|
+
Delete http://api\.getcloudapp\.dev/drops/12345 forever? (y/n)
|
|
365
|
+
yes
|
|
366
|
+
Deleting http://api\.getcloudapp\.dev/drops/12345\.\.\. done
|
|
210
367
|
.
|
|
211
368
|
.fi
|
|
212
369
|
.
|