viddlereo 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -46,5 +46,16 @@ module Viddlereo
46
46
  nil
47
47
  end
48
48
  end
49
+
50
+ def self.find_by_user(user, options = {})
51
+ begin
52
+ parse(get(:method => :getByUser,
53
+ :user => user,
54
+ :per_page => options[:per_page] || 100,
55
+ :page => options[:page] || 1))
56
+ rescue RestClient::ResourceNotFound
57
+ []
58
+ end
59
+ end
49
60
  end
50
61
  end
@@ -0,0 +1,205 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: http://api.viddler.com:80/api/v2/viddler.users.auth.xml?get_record_token=0&key=<%= key %>&password=<%= password %>&user=<%= user %>
6
+ body:
7
+ headers:
8
+ accept:
9
+ - "*/*; q=0.5, application/xml"
10
+ accept-encoding:
11
+ - gzip, deflate
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ x-viddler-node:
18
+ - viddler_k
19
+ connection:
20
+ - keep-alive
21
+ content-type:
22
+ - text/xml;charset=UTF-8
23
+ server:
24
+ - nginx/0.6.32
25
+ date:
26
+ - Sat, 20 Nov 2010 23:05:57 GMT
27
+ content-encoding:
28
+ - gzip
29
+ set-cookie:
30
+ - JSESSIONID=683A707156491795C33F73E63DA83BF2.viddler_k; Domain=.viddler.com; Path=/
31
+ vary:
32
+ - Accept-Encoding
33
+ transfer-encoding:
34
+ - chunked
35
+ body: !binary |
36
+ H4sIAAAAAAAAA7Kxr8jNUShLLSrOzM+zVTLUM1BSSM1Lzk/JzEu3VQoNcdO1
37
+ ULK347JJLC3JsLMpTi0GqctMsTNMMzM2TLMwNEo2S7KwNEtOSzUxMUkySTYx
38
+ NbE0STExNEk1Nky10UdosNEHGwEAAAD//wMAbzApRnAAAAA=
39
+
40
+ http_version: "1.1"
41
+ - !ruby/struct:VCR::HTTPInteraction
42
+ request: !ruby/struct:VCR::Request
43
+ method: :post
44
+ uri: http://api.viddler.com:80/api/v2/viddler.playlists.create.xml
45
+ body: type=smart&visibility=private&key=<%= key %>&name=Some%20Playlist&sessionid=1f631f812c6b896cfe444b4c45494d414e31e
46
+ headers:
47
+ accept:
48
+ - "*/*; q=0.5, application/xml"
49
+ content-type:
50
+ - application/x-www-form-urlencoded
51
+ accept-encoding:
52
+ - gzip, deflate
53
+ content-length:
54
+ - "123"
55
+ response: !ruby/struct:VCR::Response
56
+ status: !ruby/struct:VCR::ResponseStatus
57
+ code: 200
58
+ message: OK
59
+ headers:
60
+ x-viddler-node:
61
+ - viddler_j
62
+ connection:
63
+ - keep-alive
64
+ content-type:
65
+ - text/xml;charset=UTF-8
66
+ server:
67
+ - nginx/0.6.32
68
+ date:
69
+ - Sat, 20 Nov 2010 23:05:57 GMT
70
+ content-encoding:
71
+ - gzip
72
+ set-cookie:
73
+ - JSESSIONID=511F7D67DC87FA8653C237CE70A781B4.viddler_j; Domain=.viddler.com; Path=/
74
+ vary:
75
+ - Accept-Encoding
76
+ transfer-encoding:
77
+ - chunked
78
+ body: !binary |
79
+ H4sIAAAAAAAAA+ycWW/jNhCA3/srjLwn4n0UjIICRdEWKLDYbNFHQxbpmF1Z
80
+ EiTZSfrrSx2+YntrWFpFjvtikUOKImfI+Tw0ZfXwMo9GS5PlNonvb+AduBmZ
81
+ OEy0jZ/ub/788sutuHnwf1CRzYtxZvJFVPgqDZ6MD5VXXVVqsnEtAU60yqg0
82
+ Cl7Lu3xltc+hgICzKSeQGGak8pxQxcHc+I/J3Iw+NZWVV8lU8ZoaP58HmZNU
83
+ abW0uZ3YyBavfprZZVAY5W3J1CI3ma+/RsbOg1h5VVZli8jkdVn+pjD/7ya9
84
+ 5nZvM5Sl1SYZb6Wr0UlJtYbToB5VXgTFIvczE+hX5TU5FSyKWbLdw0agCltE
85
+ xv88+jQLcjP6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
+ kyAHqaCYkFaUO2aB8/eLh0S5qZnqUMguYrjHWbKItMn2KQf6phxqS7mVWrqn
103
+ HBoO5aBkJ1MODI5yaGefEnABBBNXTjkXzb4D5ZyLBaiVj0UHfOx6LBdFubLX
104
+ /VMOS0x4q9/kjlngY1AuINyIqQw7oNwnEy1tvsc4TPpmHGzLuJVSumccHBDj
105
+ MD+RcYgNj3FwJ5IDRDIAydUzjvd+7oRLLJBohTh40MHyCzx2Uva672MnEGJK
106
+ mGi1X3zMAh/j2EnINKTTkLdA3ONqu3L0WJh072glwj0jDsu2iFsppXPEVV0b
107
+ BOKEpBSdhDghORoc4pwitxAHGaFY0GvfrCTOK/V93MRNESglpy08LJYHPOx6
108
+ LBfFOIJY7+dNoFuiiMo228VHLMA+yIETTqcYcdjmNYIV4x5ddRuOfipmkSkT
109
+ n8tWSmkc7p2zJFj0TT7RlnwrVXVPPjEc8pETD1oOk3xih3ycM0gBvnryod6D
110
+ O0QkZlTyNn5XHPS76AKju7LXfUd3mHIBIWhz1PKoBT5IdDfRAZ5w2AX50iQr
111
+ cncxRo9+a4Q/ZzaK9nY1Eer7DQPMW4d8jaa6Bx8fDviwBCeCj5LhgY/v/HJH
112
+ OcZSXvsbBgSBLt3uaSEfhtihD7dxu/yg2wUt3O77gQ90GXSfFvJJRlzFVkH3
113
+ MQucH3QPCXwSQ0JY2EXI9zkpY74kDqLD+5ug72MquP2r4412uofdYF4dd7DD
114
+ 8ETYkeEdU8E7r44TxjFn7Np/wqOI9Q87SCWEqFWUd+jF5fVYLgp2Za97hx1z
115
+ s1/i72KBS4ZdfW3+M8Xb/h+ZfwEAAP//AwDbfmEWfEYAAA==
116
+
117
+ http_version: "1.1"
118
+ - !ruby/struct:VCR::HTTPInteraction
119
+ request: !ruby/struct:VCR::Request
120
+ method: :get
121
+ uri: http://api.viddler.com:80/api/v2/viddler.playlists.getByUser.xml?key=<%= key %>&page=1&per_page=100&sessionid=1f631f812c6b896cfe444b4c45494d414e31e&user=<%= user %>
122
+ body:
123
+ headers:
124
+ accept:
125
+ - "*/*; q=0.5, application/xml"
126
+ accept-encoding:
127
+ - gzip, deflate
128
+ response: !ruby/struct:VCR::Response
129
+ status: !ruby/struct:VCR::ResponseStatus
130
+ code: 200
131
+ message: OK
132
+ headers:
133
+ x-viddler-node:
134
+ - viddler_k
135
+ connection:
136
+ - keep-alive
137
+ content-type:
138
+ - text/xml;charset=UTF-8
139
+ server:
140
+ - nginx/0.6.32
141
+ date:
142
+ - Sat, 20 Nov 2010 23:05:57 GMT
143
+ content-encoding:
144
+ - gzip
145
+ set-cookie:
146
+ - JSESSIONID=ECEA36E8D4965302B1FDE1F7FFF3E4C0.viddler_k; Domain=.viddler.com; Path=/
147
+ vary:
148
+ - Accept-Encoding
149
+ transfer-encoding:
150
+ - chunked
151
+ body: !binary |
152
+ H4sIAAAAAAAAA9yTTU/DMAyG7/yKqndwI8Y6JM+7cZ4EnKdAzWSRpFGcVuu/
153
+ p3RDq+DAvSe/fvwhvbKMu5N3Rc9JpQ3b0txVZcHhvW0kHLfl68vT7abc0Q06
154
+ 0XxIrJ3LhNEemQzCFDFyOpxJVY3sJ8Po7PA9pldJKA3VZnNfPaw/6pVZ8Zof
155
+ EUaIwXqm59Zzsb80I0wM8xCZ1Ns0kkljLypv4iQPFJP0NjPCjGGnnKj5dCze
156
+ BoQpxdQ51nNNfxX1/5VwGYerlb+m6iWaMsszZZZwKZj9F8zf8wsAAP//AwCP
157
+ yqgq0wMAAA==
158
+
159
+ http_version: "1.1"
160
+ - !ruby/struct:VCR::HTTPInteraction
161
+ request: !ruby/struct:VCR::Request
162
+ method: :post
163
+ uri: http://api.viddler.com:80/api/v2/viddler.playlists.delete.xml
164
+ body: key=<%= key %>&playlist_id=7181076f7414e6e9&sessionid=1f631f812c6b896cfe444b4c45494d414e31e
165
+ headers:
166
+ accept:
167
+ - "*/*; q=0.5, application/xml"
168
+ content-type:
169
+ - application/x-www-form-urlencoded
170
+ accept-encoding:
171
+ - gzip, deflate
172
+ content-length:
173
+ - "101"
174
+ response: !ruby/struct:VCR::Response
175
+ status: !ruby/struct:VCR::ResponseStatus
176
+ code: 200
177
+ message: OK
178
+ headers:
179
+ x-viddler-node:
180
+ - viddler_j
181
+ connection:
182
+ - keep-alive
183
+ content-type:
184
+ - text/xml;charset=UTF-8
185
+ server:
186
+ - nginx/0.6.32
187
+ date:
188
+ - Sat, 20 Nov 2010 23:05:58 GMT
189
+ content-encoding:
190
+ - gzip
191
+ set-cookie:
192
+ - JSESSIONID=8D1DEEB550BE43510E6695AD159B5520.viddler_j; Domain=.viddler.com; Path=/
193
+ vary:
194
+ - Accept-Encoding
195
+ transfer-encoding:
196
+ - chunked
197
+ body: !binary |
198
+ H4sIAAAAAAAAA9ySMU/DQAyFd35FlB2cE6UpkutuzEiFuboSU1ncXU7nS0T+
199
+ fUNa1KgMzDDZ77OfpScZN5/eFT0nlTasS3NXlQWHt7aRcFiXry9Pt6tyQzfo
200
+ RPMusXYuE0Z7YDIIU8XIaXci1Yi+BUZnhy+XXlpCaag2q/vqYfleL8yCl/yI
201
+ MEIM1jNtW8/F83kZYWKYh8ik3qaRTD32orIXJ3mgmKS3mRFmDDvlRM2HY/E2
202
+ IEwSU+dYTzO9GurvJ+Fsh0uUn6Hq/xjK/P1QMHtFmD/yEQAA//8DAJa2ZPP9
203
+ AgAA
204
+
205
+ http_version: "1.1"
@@ -70,4 +70,21 @@ describe Viddlereo::Playlist do
70
70
  list.name.should eql(subject.name)
71
71
  end
72
72
  end
73
+
74
+ context "fetching by user" do
75
+ use_vcr_cassette :record => :new_episodes
76
+ subject { playlist }
77
+
78
+ before do
79
+ subject.save.should be_true
80
+ end
81
+
82
+ after do
83
+ subject.destroy.should be_true
84
+ end
85
+
86
+ it "returns the playlist for the logged in user" do
87
+ Viddlereo::Playlist.find_by_user(Viddlereo.configuration.user).collect{|i| i.id}.should include(subject.id)
88
+ end
89
+ end
73
90
  end
data/viddlereo.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{viddlereo}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dan Pickett"]
@@ -36,6 +36,7 @@ Gem::Specification.new do |s|
36
36
  "lib/viddlereo/video.rb",
37
37
  "spec/cassettes/Viddlereo_Playlist/creating.yml",
38
38
  "spec/cassettes/Viddlereo_Playlist/fetching.yml",
39
+ "spec/cassettes/Viddlereo_Playlist/fetching_by_user.yml",
39
40
  "spec/cassettes/echo/message.yml",
40
41
  "spec/cassettes/session/get_key.yml",
41
42
  "spec/spec_helper.rb",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: viddlereo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dan Pickett
@@ -241,6 +241,7 @@ files:
241
241
  - lib/viddlereo/video.rb
242
242
  - spec/cassettes/Viddlereo_Playlist/creating.yml
243
243
  - spec/cassettes/Viddlereo_Playlist/fetching.yml
244
+ - spec/cassettes/Viddlereo_Playlist/fetching_by_user.yml
244
245
  - spec/cassettes/echo/message.yml
245
246
  - spec/cassettes/session/get_key.yml
246
247
  - spec/spec_helper.rb