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
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
require 'addressable/uri'
|
|
2
|
-
require 'fileutils'
|
|
3
|
-
require 'leadlight'
|
|
4
|
-
require 'multi_json'
|
|
5
|
-
require 'cloudapp/drop'
|
|
6
|
-
require 'cloudapp/drop_content'
|
|
7
|
-
|
|
8
|
-
# Leadlight service for mucking about with drops in the CloudApp API.
|
|
9
|
-
#
|
|
10
|
-
# Usage:
|
|
11
|
-
#
|
|
12
|
-
# # Retrieve an account's token
|
|
13
|
-
# token = DropSerivce.retrieve_token 'arthur@dent.com', 'towel'
|
|
14
|
-
#
|
|
15
|
-
# # Create a new service passing CloudApp account token:
|
|
16
|
-
# service = DropSerivce.using_token token
|
|
17
|
-
#
|
|
18
|
-
# # List all drops:
|
|
19
|
-
# service.drops
|
|
20
|
-
#
|
|
21
|
-
# # Create a bookmark:
|
|
22
|
-
# service.create url: 'http://getcloudapp.com', name: 'CloudApp'
|
|
23
|
-
#
|
|
24
|
-
# # Upload a file:
|
|
25
|
-
# service.create path: #<Pathname>, name: 'Screen shot'
|
|
26
|
-
#
|
|
27
|
-
# # Use a public (short) link for the new drop:
|
|
28
|
-
# service.create url: 'http://getcloudapp.com',
|
|
29
|
-
# name: 'CloudApp',
|
|
30
|
-
# private: false
|
|
31
|
-
#
|
|
32
|
-
# # List all trashed drops:
|
|
33
|
-
# service.trash
|
|
34
|
-
#
|
|
35
|
-
# # Delete a drop (not yet implemented):
|
|
36
|
-
# service.drops.get(123).destroy
|
|
37
|
-
#
|
|
38
|
-
# # Delete a drop from the trash (not yet implemented):
|
|
39
|
-
# service.trash.get(123).destroy
|
|
40
|
-
#
|
|
41
|
-
# # Restore a drop from the trash (not yet implemented):
|
|
42
|
-
# service.trash.get(123).restore
|
|
43
|
-
#
|
|
44
|
-
module CloudApp
|
|
45
|
-
class DropService
|
|
46
|
-
|
|
47
|
-
# Rased when given credentials are incorrect.
|
|
48
|
-
class UNAUTHORIZED < StandardError; end
|
|
49
|
-
class NO_CONTENT < StandardError; end
|
|
50
|
-
|
|
51
|
-
Leadlight.build_connection_common do |c|
|
|
52
|
-
c.request :multipart
|
|
53
|
-
c.request :url_encoded
|
|
54
|
-
c.adapter :typhoeus
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
Leadlight.build_service(self) do
|
|
58
|
-
url 'https://my.cl.ly'
|
|
59
|
-
|
|
60
|
-
# Add links present in the response body.
|
|
61
|
-
# { links: { self: "...", next: "...", prev: "..." } }
|
|
62
|
-
tint 'links' do
|
|
63
|
-
match Hash
|
|
64
|
-
match { key? 'links' }
|
|
65
|
-
self['links'].each do |rel, href|
|
|
66
|
-
add_link href, rel
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
tint 'force_ssl_s3_upload' do
|
|
71
|
-
match_path '/items/new'
|
|
72
|
-
uri = Addressable::URI.parse self['url']
|
|
73
|
-
self['url'] = "https://s3.amazonaws.com/#{ uri.host }#{ uri.request_uri }"
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
tint 'root' do
|
|
77
|
-
match_path '/'
|
|
78
|
-
add_link '/items?api_version=1.2', 'drops', 'List owned drops'
|
|
79
|
-
add_link_template '/items?api_version=1.2&per_page={per_page=20}', 'paginated_drops'
|
|
80
|
-
add_link_template '/items?api_version=1.2&per_page={per_page=20}&deleted=true', 'paginated_trash'
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
tint 'create' do
|
|
84
|
-
match_path '/items'
|
|
85
|
-
# use "#{__location__}/new" when api_version isn't required in the query
|
|
86
|
-
# string.
|
|
87
|
-
add_link '/items/new', 'create_file', 'Create a new file drop'
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
# Add a rel=child link for each item in the list.
|
|
91
|
-
# { items: [{ id: 123, href: "..."}] }
|
|
92
|
-
tint 'drops' do
|
|
93
|
-
match_path '/items'
|
|
94
|
-
match { key? 'items' }
|
|
95
|
-
add_link_set 'child', :get do
|
|
96
|
-
self['items'].map do |item|
|
|
97
|
-
{ href: item['href'], title: item['id'] }
|
|
98
|
-
end
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
# Add convenience methods on a drop representation to destroy and restore
|
|
103
|
-
# from the trash.
|
|
104
|
-
tint 'drop' do
|
|
105
|
-
match_template '/items/{id}'
|
|
106
|
-
extend do
|
|
107
|
-
def destroy
|
|
108
|
-
link('self').delete.
|
|
109
|
-
raise_on_error.submit_and_wait
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def restore
|
|
113
|
-
link('self').put({}, deleted: true, item: { deleted_at: nil }).
|
|
114
|
-
raise_on_error.submit_and_wait
|
|
115
|
-
end
|
|
116
|
-
end
|
|
117
|
-
end
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
# Temporarily disable SSL verification until new SSL cert has been added to
|
|
121
|
-
# production.
|
|
122
|
-
on_prepare_request do |event, request|
|
|
123
|
-
def request.to_env(*args)
|
|
124
|
-
super.tap do |env|
|
|
125
|
-
env[:ssl] = { verify: false }
|
|
126
|
-
end
|
|
127
|
-
end
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
def initialize(*args)
|
|
131
|
-
super
|
|
132
|
-
logger.level = Logger::WARN
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
def self.using_token(token)
|
|
136
|
-
new.tap do |service|
|
|
137
|
-
service.token = token
|
|
138
|
-
end
|
|
139
|
-
end
|
|
140
|
-
|
|
141
|
-
def self.retrieve_token(email, password)
|
|
142
|
-
new.token email, password
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
def token=(token)
|
|
147
|
-
connection.token_auth token
|
|
148
|
-
end
|
|
149
|
-
|
|
150
|
-
def token(email, password)
|
|
151
|
-
post('/account/token', {}, { email: email, password: password }).
|
|
152
|
-
raise_on_error.submit_and_wait do |response|
|
|
153
|
-
return response['token']
|
|
154
|
-
end
|
|
155
|
-
rescue MultiJson::DecodeError => e
|
|
156
|
-
raise UNAUTHORIZED
|
|
157
|
-
end
|
|
158
|
-
|
|
159
|
-
def drop(url)
|
|
160
|
-
conn = Faraday.new(url: url) do |builder|
|
|
161
|
-
builder.response :logger, logger
|
|
162
|
-
builder.adapter :typhoeus
|
|
163
|
-
end
|
|
164
|
-
|
|
165
|
-
conn.get do |req|
|
|
166
|
-
req.headers['Accept'] = 'application/json'
|
|
167
|
-
end.on_complete do |env|
|
|
168
|
-
if env.fetch(:response).status == 200
|
|
169
|
-
drop = Drop.new(MultiJson.decode(env[:body]))
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
return drop
|
|
173
|
-
end
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
def download_drop(url, options = {})
|
|
177
|
-
drop = drop url
|
|
178
|
-
raise NO_CONTENT if drop.nil? or !drop.has_content?
|
|
179
|
-
|
|
180
|
-
filename = Addressable::URI.unencode(File.basename(drop.content_url))
|
|
181
|
-
path = Pathname.new(options.fetch(:to, filename)).expand_path
|
|
182
|
-
FileUtils.mkdir_p path.parent
|
|
183
|
-
|
|
184
|
-
DropContent.download(drop).tap do |content|
|
|
185
|
-
File.open(path, 'w', 0600) {|file| file << content }
|
|
186
|
-
end
|
|
187
|
-
end
|
|
188
|
-
|
|
189
|
-
def drops(count = 20)
|
|
190
|
-
root.paginated_drops(per_page: count)['items'].map do |drop_data|
|
|
191
|
-
Drop.new drop_data
|
|
192
|
-
end
|
|
193
|
-
rescue MultiJson::DecodeError => e
|
|
194
|
-
raise UNAUTHORIZED
|
|
195
|
-
end
|
|
196
|
-
|
|
197
|
-
def trash(count = 20)
|
|
198
|
-
root.paginated_trash(per_page: count)['items'].map do |drop_data|
|
|
199
|
-
Drop.new drop_data
|
|
200
|
-
end
|
|
201
|
-
rescue MultiJson::DecodeError => e
|
|
202
|
-
raise UNAUTHORIZED
|
|
203
|
-
end
|
|
204
|
-
|
|
205
|
-
def create(attributes)
|
|
206
|
-
options = { item: {}}
|
|
207
|
-
options[:item][:name] = attributes[:name] if attributes.key? :name
|
|
208
|
-
options[:item][:redirect_url] = attributes[:url] if attributes.key? :url
|
|
209
|
-
options[:item][:private] = attributes[:private] if attributes.key? :private
|
|
210
|
-
|
|
211
|
-
if attributes.key? :path
|
|
212
|
-
create_file attributes[:path], options
|
|
213
|
-
else
|
|
214
|
-
create_bookmark options
|
|
215
|
-
end
|
|
216
|
-
rescue MultiJson::DecodeError => e
|
|
217
|
-
raise UNAUTHORIZED
|
|
218
|
-
end
|
|
219
|
-
|
|
220
|
-
protected
|
|
221
|
-
|
|
222
|
-
def create_bookmark(options)
|
|
223
|
-
root.link('drops').post({}, options).raise_on_error.
|
|
224
|
-
submit_and_wait do |new_drop|
|
|
225
|
-
return Drop.new new_drop
|
|
226
|
-
end
|
|
227
|
-
end
|
|
228
|
-
|
|
229
|
-
def create_file(path, options)
|
|
230
|
-
root.drops.link('create_file').get(options).raise_on_error.
|
|
231
|
-
submit_and_wait do |details|
|
|
232
|
-
uri = Addressable::URI.parse details['url']
|
|
233
|
-
file = Faraday::UploadIO.new File.open(path), 'image/png'
|
|
234
|
-
payload = details['params'].merge file: file
|
|
235
|
-
|
|
236
|
-
conn = Faraday.new(url: uri.site) do |builder|
|
|
237
|
-
builder.request :multipart
|
|
238
|
-
builder.request :url_encoded
|
|
239
|
-
builder.response :logger, logger
|
|
240
|
-
builder.adapter :typhoeus
|
|
241
|
-
end
|
|
242
|
-
|
|
243
|
-
conn.post(uri.request_uri, payload).on_complete do |env|
|
|
244
|
-
# Follow redirect back to API using SSL.
|
|
245
|
-
location = Addressable::URI.parse env[:response_headers]['Location']
|
|
246
|
-
location.scheme = 'https'
|
|
247
|
-
|
|
248
|
-
get(location).raise_on_error.submit_and_wait do |new_drop|
|
|
249
|
-
return Drop.new new_drop
|
|
250
|
-
end
|
|
251
|
-
end
|
|
252
|
-
end
|
|
253
|
-
end
|
|
254
|
-
end
|
|
255
|
-
end
|
data/lib/cloudapp/identity.rb
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
module CloudApp
|
|
2
|
-
class Identity
|
|
3
|
-
attr_accessor :email, :password
|
|
4
|
-
|
|
5
|
-
def initialize(email, password)
|
|
6
|
-
@email = email
|
|
7
|
-
@password = password
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def self.from_config(config)
|
|
11
|
-
new(config.fetch(:email), config.fetch(:password))
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
http_interactions:
|
|
3
|
-
- request:
|
|
4
|
-
method: get
|
|
5
|
-
uri: http://cl.ly/C23W/drop_presenter.rb
|
|
6
|
-
body: ''
|
|
7
|
-
headers:
|
|
8
|
-
Accept:
|
|
9
|
-
- application/json
|
|
10
|
-
response:
|
|
11
|
-
status:
|
|
12
|
-
code: 302
|
|
13
|
-
message: Moved Temporarily
|
|
14
|
-
headers:
|
|
15
|
-
Server:
|
|
16
|
-
- nginx
|
|
17
|
-
Date:
|
|
18
|
-
- Fri, 17 Feb 2012 01:43:07 GMT
|
|
19
|
-
Content-Type:
|
|
20
|
-
- text/html;charset=utf-8
|
|
21
|
-
Connection:
|
|
22
|
-
- keep-alive
|
|
23
|
-
Vary:
|
|
24
|
-
- Accept
|
|
25
|
-
Cache-Control:
|
|
26
|
-
- public, max-age=900
|
|
27
|
-
Location:
|
|
28
|
-
- http://api.cld.me/C23W/drop_presenter.rb
|
|
29
|
-
X-Content-Digest:
|
|
30
|
-
- da39a3ee5e6b4b0d3255bfef95601890afd80709
|
|
31
|
-
X-Rack-Cache:
|
|
32
|
-
- stale, invalid, store
|
|
33
|
-
Content-Length:
|
|
34
|
-
- '0'
|
|
35
|
-
X-Varnish:
|
|
36
|
-
- '1852427632'
|
|
37
|
-
Age:
|
|
38
|
-
- '0'
|
|
39
|
-
Via:
|
|
40
|
-
- 1.1 varnish
|
|
41
|
-
body: ''
|
|
42
|
-
http_version:
|
|
43
|
-
recorded_at: Fri, 17 Feb 2012 01:43:07 GMT
|
|
44
|
-
- request:
|
|
45
|
-
method: get
|
|
46
|
-
uri: http://api.cld.me/C23W/drop_presenter.rb
|
|
47
|
-
body: ''
|
|
48
|
-
headers:
|
|
49
|
-
Accept:
|
|
50
|
-
- application/json
|
|
51
|
-
response:
|
|
52
|
-
status:
|
|
53
|
-
code: 302
|
|
54
|
-
message: Moved Temporarily
|
|
55
|
-
headers:
|
|
56
|
-
Cache-Control:
|
|
57
|
-
- no-cache
|
|
58
|
-
Content-Type:
|
|
59
|
-
- text/html; charset=utf-8
|
|
60
|
-
Location:
|
|
61
|
-
- http://f.cl.ly/items/152S3l2X1y3P2M262D3V/drop_presenter.rb
|
|
62
|
-
Server:
|
|
63
|
-
- thin 1.3.1 codename Triple Espresso
|
|
64
|
-
X-Runtime:
|
|
65
|
-
- '0.025914'
|
|
66
|
-
X-Ua-Compatible:
|
|
67
|
-
- IE=Edge,chrome=1
|
|
68
|
-
Transfer-Encoding:
|
|
69
|
-
- chunked
|
|
70
|
-
Connection:
|
|
71
|
-
- keep-alive
|
|
72
|
-
body: <html><body>You are being <a href="http://f.cl.ly/items/152S3l2X1y3P2M262D3V/drop_presenter.rb">redirected</a>.</body></html>
|
|
73
|
-
http_version:
|
|
74
|
-
recorded_at: Fri, 17 Feb 2012 01:44:07 GMT
|
|
75
|
-
- request:
|
|
76
|
-
method: get
|
|
77
|
-
uri: http://f.cl.ly/items/152S3l2X1y3P2M262D3V/drop_presenter.rb
|
|
78
|
-
body: ''
|
|
79
|
-
headers:
|
|
80
|
-
Accept:
|
|
81
|
-
- application/json
|
|
82
|
-
response:
|
|
83
|
-
status:
|
|
84
|
-
code: 200
|
|
85
|
-
message: OK
|
|
86
|
-
headers:
|
|
87
|
-
X-Amz-Id-2:
|
|
88
|
-
- iyFXxRKOKM5CYt1f7jI9bN8btGeacX2VeXxCIMNL2/AQNzPEH7pAIUjQ9A4Q/TYC
|
|
89
|
-
X-Amz-Request-Id:
|
|
90
|
-
- 9092E1275FD0C3F5
|
|
91
|
-
Date:
|
|
92
|
-
- Fri, 17 Feb 2012 01:44:09 GMT
|
|
93
|
-
Last-Modified:
|
|
94
|
-
- Tue, 22 Nov 2011 19:40:51 GMT
|
|
95
|
-
Etag:
|
|
96
|
-
- ! '"f24a305d5a90516f0b0877b93158ee0a"'
|
|
97
|
-
Accept-Ranges:
|
|
98
|
-
- bytes
|
|
99
|
-
Content-Type:
|
|
100
|
-
- application/ruby
|
|
101
|
-
Content-Length:
|
|
102
|
-
- '610'
|
|
103
|
-
Server:
|
|
104
|
-
- AmazonS3
|
|
105
|
-
body: ! "require 'delegate'\nrequire 'yajl'\n\nclass DropPresenter < SimpleDelegator\n
|
|
106
|
-
\ def initialize(drop, template)\n @template = template\n\n super drop\n
|
|
107
|
-
\ end\n\n def render_html\n if bookmark?\n @template.redirect_to_api\n
|
|
108
|
-
\ else\n @template.erb template_name, locals: { drop: self, body_id:
|
|
109
|
-
body_id }\n end\n end\n\n def render_json\n Yajl::Encoder.encode data\n
|
|
110
|
-
\ end\n\nprivate\n\n def template_name\n if image?\n :image\n elsif
|
|
111
|
-
text?\n :text\n else\n :other\n end\n end\n\n def body_id\n
|
|
112
|
-
\ if image?\n 'image'\n elsif text?\n 'text'\n else\n 'other'\n
|
|
113
|
-
\ end\n end\n\nend\n"
|
|
114
|
-
http_version:
|
|
115
|
-
recorded_at: Fri, 17 Feb 2012 01:44:08 GMT
|
|
116
|
-
recorded_with: VCR 2.0.0.rc1
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
http_interactions:
|
|
3
|
-
- request:
|
|
4
|
-
method: get
|
|
5
|
-
uri: https://my.cl.ly/
|
|
6
|
-
body: ''
|
|
7
|
-
headers:
|
|
8
|
-
Authorization:
|
|
9
|
-
- Token token="8762f6679f8d001016b2"
|
|
10
|
-
Accept:
|
|
11
|
-
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
|
12
|
-
text/plain
|
|
13
|
-
response:
|
|
14
|
-
status:
|
|
15
|
-
code: 200
|
|
16
|
-
message: OK
|
|
17
|
-
headers:
|
|
18
|
-
Cache-Control:
|
|
19
|
-
- max-age=0, private, must-revalidate
|
|
20
|
-
Content-Type:
|
|
21
|
-
- application/json; charset=utf-8
|
|
22
|
-
Etag:
|
|
23
|
-
- ! '"857fd84f26ef95ce47d9d41d1b235cf8"'
|
|
24
|
-
Last-Modified:
|
|
25
|
-
- Tue, 14 Feb 2012 14:24:16 GMT
|
|
26
|
-
Server:
|
|
27
|
-
- thin 1.3.1 codename Triple Espresso
|
|
28
|
-
X-Runtime:
|
|
29
|
-
- '0.087165'
|
|
30
|
-
X-Ua-Compatible:
|
|
31
|
-
- IE=Edge,chrome=1
|
|
32
|
-
Transfer-Encoding:
|
|
33
|
-
- chunked
|
|
34
|
-
Connection:
|
|
35
|
-
- keep-alive
|
|
36
|
-
body: ! '[{"created_at":"2012-01-12T20:49:23Z","deleted_at":null,"id":13950097,"item_type":"image","name":"favicon.ico","private":true,"redirect_url":null,"remote_url":"http://f.cl.ly/items/0p2t030e0a1N091o2t3o/favicon.ico","source":"Mozilla/5.0
|
|
37
|
-
(Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75
|
|
38
|
-
Safari/535.7","updated_at":"2012-02-07T15:34:17Z","view_counter":3,"href":"http://my.cl.ly/items/13950097","url":"http://cl.ly/0P281s1u1J1p47241B3o","content_url":"http://cl.ly/0P281s1u1J1p47241B3o/favicon.ico","icon":"http://assets.my.cld.me/images/item-types/image.png","thumbnail_url":"http://thumbs.cl.ly/0P281s1u1J1p47241B3o","subscribed":false,"download_url":"http://api.cld.me/0P281s1u1J1p47241B3o/download/favicon.ico"},{"created_at":"2012-01-12T20:49:13Z","deleted_at":null,"id":13950087,"item_type":"image","name":"\u00f8\u00e6\u00d8\u00fc\u00f6\u00e4\u00df!?&+-.jpeg","private":true,"redirect_url":null,"remote_url":"http://f.cl.ly/items/0p2t030e0a1N091o2t3o/%C3%B8%C3%A6%C3%98%C3%BC%C3%B6%C3%A4%C3%9F!%3F&%2B-.jpeg","source":"Mozilla/5.0
|
|
39
|
-
(Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75
|
|
40
|
-
Safari/535.7","updated_at":"2012-01-18T23:25:10Z","view_counter":6,"href":"http://my.cl.ly/items/13950087","url":"http://cl.ly/2n3a3S3f0J2w3X453r3L","content_url":"http://cl.ly/2n3a3S3f0J2w3X453r3L/%C3%B8%C3%A6%C3%98%C3%BC%C3%B6%C3%A4%C3%9F!%3F&%2B-.jpeg","icon":"http://assets.my.cld.me/images/item-types/image.png","thumbnail_url":"http://thumbs.cl.ly/2n3a3S3f0J2w3X453r3L","subscribed":false,"download_url":"http://api.cld.me/2n3a3S3f0J2w3X453r3L/download/%C3%B8%C3%A6%C3%98%C3%BC%C3%B6%C3%A4%C3%9F!%3F&%2B-.jpeg"},{"created_at":"2012-01-12T20:48:03Z","deleted_at":null,"id":13950015,"item_type":"bookmark","name":"The
|
|
41
|
-
Hitchhiker''s Guide to the Galaxy","private":true,"redirect_url":"http://en.wikipedia.org/wiki/The_Hitchhiker''s_Guide_to_the_Galaxy","remote_url":null,"source":"Mozilla/5.0
|
|
42
|
-
(Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75
|
|
43
|
-
Safari/535.7","updated_at":"2012-02-07T15:34:23Z","view_counter":4,"href":"http://my.cl.ly/items/13950015","url":"http://cl.ly/3I28311d3n3S0x3R3k2Y","content_url":"http://cl.ly/3I28311d3n3S0x3R3k2Y","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false},{"created_at":"2012-01-12T20:45:24Z","deleted_at":null,"id":13949886,"item_type":"audio","name":"Epic
|
|
44
|
-
Sax Guy NES Remix.mp3","private":true,"redirect_url":null,"remote_url":"http://f.cl.ly/items/0p2t030e0a1N091o2t3o/Epic%20Sax%20Guy%20NES%20Remix.mp3","source":"Mozilla/5.0
|
|
45
|
-
(Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75
|
|
46
|
-
Safari/535.7","updated_at":"2012-01-12T20:45:24Z","view_counter":0,"href":"http://my.cl.ly/items/13949886","url":"http://cl.ly/322M3q1t261o30012s32","content_url":"http://cl.ly/322M3q1t261o30012s32/Epic%20Sax%20Guy%20NES%20Remix.mp3","icon":"http://assets.my.cld.me/images/item-types/audio.png","subscribed":false,"download_url":"http://api.cld.me/322M3q1t261o30012s32/download/Epic%20Sax%20Guy%20NES%20Remix.mp3"},{"created_at":"2012-01-12T20:45:05Z","deleted_at":null,"id":13949869,"item_type":"text","name":"2011-05-03-cloudapp-1.5-released.md","private":true,"redirect_url":null,"remote_url":"http://f.cl.ly/items/0p2t030e0a1N091o2t3o/2011-05-03-cloudapp-1.5-released.md","source":"Mozilla/5.0
|
|
47
|
-
(Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75
|
|
48
|
-
Safari/535.7","updated_at":"2012-02-07T15:35:28Z","view_counter":4,"href":"http://my.cl.ly/items/13949869","url":"http://cl.ly/0s1o3A46290S1s331G28","content_url":"http://cl.ly/0s1o3A46290S1s331G28/2011-05-03-cloudapp-1.5-released.md","icon":"http://assets.my.cld.me/images/item-types/text.png","subscribed":false,"download_url":"http://api.cld.me/0s1o3A46290S1s331G28/download/2011-05-03-cloudapp-1.5-released.md"},{"created_at":"2012-01-12T20:44:58Z","deleted_at":null,"id":13949858,"item_type":"image","name":"Cover.jpeg","private":true,"redirect_url":null,"remote_url":"http://f.cl.ly/items/0p2t030e0a1N091o2t3o/Cover.jpeg","source":"Mozilla/5.0
|
|
49
|
-
(Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75
|
|
50
|
-
Safari/535.7","updated_at":"2012-02-07T15:34:41Z","view_counter":1,"href":"http://my.cl.ly/items/13949858","url":"http://cl.ly/1x200A0m3v101d1n2O1u","content_url":"http://cl.ly/1x200A0m3v101d1n2O1u/Cover.jpeg","icon":"http://assets.my.cld.me/images/item-types/image.png","thumbnail_url":"http://thumbs.cl.ly/1x200A0m3v101d1n2O1u","subscribed":false,"download_url":"http://api.cld.me/1x200A0m3v101d1n2O1u/download/Cover.jpeg"},{"created_at":"2012-01-12T20:44:54Z","deleted_at":null,"id":13949855,"item_type":"text","name":"Chapter
|
|
51
|
-
1.md","private":true,"redirect_url":null,"remote_url":"http://f.cl.ly/items/0p2t030e0a1N091o2t3o/Chapter%201.md","source":"Mozilla/5.0
|
|
52
|
-
(Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75
|
|
53
|
-
Safari/535.7","updated_at":"2012-02-10T02:09:36Z","view_counter":8,"href":"http://my.cl.ly/items/13949855","url":"http://cl.ly/3U3d3w3r0G0T1T1M0d2T","content_url":"http://cl.ly/3U3d3w3r0G0T1T1M0d2T/Chapter%201.md","icon":"http://assets.my.cld.me/images/item-types/text.png","subscribed":false,"download_url":"http://api.cld.me/3U3d3w3r0G0T1T1M0d2T/download/Chapter%201.md"},{"created_at":"2012-01-12T20:39:04Z","deleted_at":null,"id":13949577,"item_type":"bookmark","name":"Link
|
|
54
|
-
40","private":true,"redirect_url":"http://getcloudapp.com","remote_url":null,"source":null,"updated_at":"2012-02-07T15:35:45Z","view_counter":3,"href":"http://my.cl.ly/items/13949577","url":"http://cl.ly/2O2J1h3t0H0v1I1u0t0P","content_url":"http://cl.ly/2O2J1h3t0H0v1I1u0t0P","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false},{"created_at":"2012-01-12T20:39:04Z","deleted_at":null,"id":13949576,"item_type":"bookmark","name":"Link
|
|
55
|
-
39","private":true,"redirect_url":"http://getcloudapp.com","remote_url":null,"source":null,"updated_at":"2012-01-12T20:39:04Z","view_counter":0,"href":"http://my.cl.ly/items/13949576","url":"http://cl.ly/2t062C1h393d2L452U2Z","content_url":"http://cl.ly/2t062C1h393d2L452U2Z","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false},{"created_at":"2012-01-12T20:39:04Z","deleted_at":null,"id":13949575,"item_type":"bookmark","name":"Link
|
|
56
|
-
38","private":true,"redirect_url":"http://getcloudapp.com","remote_url":null,"source":null,"updated_at":"2012-01-12T20:39:04Z","view_counter":0,"href":"http://my.cl.ly/items/13949575","url":"http://cl.ly/1S131o2v2J3z2r0A0Q0W","content_url":"http://cl.ly/1S131o2v2J3z2r0A0Q0W","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false},{"created_at":"2012-01-12T20:39:04Z","deleted_at":null,"id":13949574,"item_type":"bookmark","name":"Link
|
|
57
|
-
37","private":true,"redirect_url":"http://getcloudapp.com","remote_url":null,"source":null,"updated_at":"2012-01-12T20:39:04Z","view_counter":0,"href":"http://my.cl.ly/items/13949574","url":"http://cl.ly/423a3W361X1l1i2w0q30","content_url":"http://cl.ly/423a3W361X1l1i2w0q30","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false},{"created_at":"2012-01-12T20:39:04Z","deleted_at":null,"id":13949573,"item_type":"bookmark","name":"Link
|
|
58
|
-
36","private":true,"redirect_url":"http://getcloudapp.com","remote_url":null,"source":null,"updated_at":"2012-01-12T20:39:04Z","view_counter":0,"href":"http://my.cl.ly/items/13949573","url":"http://cl.ly/3m3u2b1y461a2M3i0a0o","content_url":"http://cl.ly/3m3u2b1y461a2M3i0a0o","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false},{"created_at":"2012-01-12T20:39:04Z","deleted_at":null,"id":13949572,"item_type":"bookmark","name":"Link
|
|
59
|
-
35","private":true,"redirect_url":"http://getcloudapp.com","remote_url":null,"source":null,"updated_at":"2012-01-12T20:39:04Z","view_counter":0,"href":"http://my.cl.ly/items/13949572","url":"http://cl.ly/1Q1G170D1B2c2X3R0C2M","content_url":"http://cl.ly/1Q1G170D1B2c2X3R0C2M","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false},{"created_at":"2012-01-12T20:39:04Z","deleted_at":null,"id":13949571,"item_type":"bookmark","name":"Link
|
|
60
|
-
34","private":true,"redirect_url":"http://getcloudapp.com","remote_url":null,"source":null,"updated_at":"2012-01-12T20:39:04Z","view_counter":0,"href":"http://my.cl.ly/items/13949571","url":"http://cl.ly/3s153f2u3m1L471T390C","content_url":"http://cl.ly/3s153f2u3m1L471T390C","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false},{"created_at":"2012-01-12T20:39:04Z","deleted_at":null,"id":13949570,"item_type":"bookmark","name":"Link
|
|
61
|
-
33","private":true,"redirect_url":"http://getcloudapp.com","remote_url":null,"source":null,"updated_at":"2012-01-12T20:39:04Z","view_counter":0,"href":"http://my.cl.ly/items/13949570","url":"http://cl.ly/1W2f000i091B2128303J","content_url":"http://cl.ly/1W2f000i091B2128303J","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false},{"created_at":"2012-01-12T20:39:04Z","deleted_at":null,"id":13949568,"item_type":"bookmark","name":"Link
|
|
62
|
-
32","private":true,"redirect_url":"http://getcloudapp.com","remote_url":null,"source":null,"updated_at":"2012-01-12T20:39:04Z","view_counter":0,"href":"http://my.cl.ly/items/13949568","url":"http://cl.ly/333d0V1B403M0d2f2o09","content_url":"http://cl.ly/333d0V1B403M0d2f2o09","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false},{"created_at":"2012-01-12T20:39:03Z","deleted_at":null,"id":13949567,"item_type":"bookmark","name":"Link
|
|
63
|
-
31","private":true,"redirect_url":"http://getcloudapp.com","remote_url":null,"source":null,"updated_at":"2012-01-12T20:39:03Z","view_counter":0,"href":"http://my.cl.ly/items/13949567","url":"http://cl.ly/260m2h3T0O2P272k2F3h","content_url":"http://cl.ly/260m2h3T0O2P272k2F3h","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false},{"created_at":"2012-01-12T20:39:03Z","deleted_at":null,"id":13949566,"item_type":"bookmark","name":"Link
|
|
64
|
-
30","private":true,"redirect_url":"http://getcloudapp.com","remote_url":null,"source":null,"updated_at":"2012-01-12T20:39:03Z","view_counter":0,"href":"http://my.cl.ly/items/13949566","url":"http://cl.ly/411H1g1a3y2T2B3U322x","content_url":"http://cl.ly/411H1g1a3y2T2B3U322x","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false},{"created_at":"2012-01-12T20:39:03Z","deleted_at":null,"id":13949565,"item_type":"bookmark","name":"Link
|
|
65
|
-
29","private":true,"redirect_url":"http://getcloudapp.com","remote_url":null,"source":null,"updated_at":"2012-01-12T20:39:03Z","view_counter":0,"href":"http://my.cl.ly/items/13949565","url":"http://cl.ly/3B1V3H0c0c3s3O2u1Q0c","content_url":"http://cl.ly/3B1V3H0c0c3s3O2u1Q0c","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false},{"created_at":"2012-01-12T20:39:03Z","deleted_at":null,"id":13949564,"item_type":"bookmark","name":"Link
|
|
66
|
-
28","private":true,"redirect_url":"http://getcloudapp.com","remote_url":null,"source":null,"updated_at":"2012-01-12T20:39:03Z","view_counter":0,"href":"http://my.cl.ly/items/13949564","url":"http://cl.ly/1w2e1K3j0T14193P2y1j","content_url":"http://cl.ly/1w2e1K3j0T14193P2y1j","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false}]'
|
|
67
|
-
http_version:
|
|
68
|
-
recorded_at: Tue, 14 Feb 2012 14:35:01 GMT
|
|
69
|
-
- request:
|
|
70
|
-
method: post
|
|
71
|
-
uri: https://my.cl.ly/items?api_version=1.2
|
|
72
|
-
body: ! '{"item":{"redirect_url":"http://getcloudapp.com"}}'
|
|
73
|
-
headers:
|
|
74
|
-
Content-Type:
|
|
75
|
-
- application/json
|
|
76
|
-
Authorization:
|
|
77
|
-
- Token token="8762f6679f8d001016b2"
|
|
78
|
-
Accept:
|
|
79
|
-
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
|
80
|
-
text/plain
|
|
81
|
-
response:
|
|
82
|
-
status:
|
|
83
|
-
code: 200
|
|
84
|
-
message: OK
|
|
85
|
-
headers:
|
|
86
|
-
Cache-Control:
|
|
87
|
-
- max-age=0, private, must-revalidate
|
|
88
|
-
Content-Type:
|
|
89
|
-
- application/json; charset=utf-8
|
|
90
|
-
Etag:
|
|
91
|
-
- ! '"ac70569a55f8f0d602f4322ce4b40da4"'
|
|
92
|
-
Server:
|
|
93
|
-
- thin 1.3.1 codename Triple Espresso
|
|
94
|
-
X-Runtime:
|
|
95
|
-
- '0.057528'
|
|
96
|
-
X-Ua-Compatible:
|
|
97
|
-
- IE=Edge,chrome=1
|
|
98
|
-
Transfer-Encoding:
|
|
99
|
-
- chunked
|
|
100
|
-
Connection:
|
|
101
|
-
- keep-alive
|
|
102
|
-
body: ! '{"created_at":"2012-02-14T14:35:01Z","deleted_at":null,"id":15182703,"item_type":"bookmark","name":null,"private":true,"redirect_url":"http://getcloudapp.com","remote_url":null,"source":null,"updated_at":"2012-02-14T14:35:01Z","view_counter":0,"href":"http://my.cl.ly/items/15182703","url":"http://cl.ly/0F2c181b3Q30371t2F3g","content_url":"http://cl.ly/0F2c181b3Q30371t2F3g","icon":"http://assets.my.cld.me/images/item-types/bookmark.png","subscribed":false}'
|
|
103
|
-
http_version:
|
|
104
|
-
recorded_at: Tue, 14 Feb 2012 14:35:01 GMT
|
|
105
|
-
recorded_with: VCR 2.0.0.rc1
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
http_interactions:
|
|
3
|
-
- request:
|
|
4
|
-
method: get
|
|
5
|
-
uri: https://my.cl.ly/
|
|
6
|
-
body: ''
|
|
7
|
-
headers:
|
|
8
|
-
Authorization:
|
|
9
|
-
- Token token="bad-token"
|
|
10
|
-
Accept:
|
|
11
|
-
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
|
12
|
-
text/plain
|
|
13
|
-
response:
|
|
14
|
-
status:
|
|
15
|
-
code: 401
|
|
16
|
-
message: Unauthorized
|
|
17
|
-
headers:
|
|
18
|
-
Cache-Control:
|
|
19
|
-
- no-cache
|
|
20
|
-
Content-Type:
|
|
21
|
-
- application/json; charset=utf-8
|
|
22
|
-
Server:
|
|
23
|
-
- thin 1.3.1 codename Triple Espresso
|
|
24
|
-
Www-Authenticate:
|
|
25
|
-
- Token realm="Application"
|
|
26
|
-
X-Runtime:
|
|
27
|
-
- '0.084830'
|
|
28
|
-
X-Ua-Compatible:
|
|
29
|
-
- IE=Edge,chrome=1
|
|
30
|
-
Transfer-Encoding:
|
|
31
|
-
- chunked
|
|
32
|
-
Connection:
|
|
33
|
-
- keep-alive
|
|
34
|
-
body: ! 'HTTP Token: Access denied.
|
|
35
|
-
|
|
36
|
-
'
|
|
37
|
-
http_version:
|
|
38
|
-
recorded_at: Tue, 14 Feb 2012 14:44:20 GMT
|
|
39
|
-
recorded_with: VCR 2.0.0.rc1
|