vimeo 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -133,10 +133,15 @@ Once the user has allowed your application to access their account, they will be
133
133
  user.secret = access_token.secret
134
134
  user.save
135
135
 
136
+ *Note*: if you are trying to get your access tokens manually, then the above block of code will be a little different:
137
+
138
+ - `params[:oauth_token]` is the same as `request_token.token`
139
+ - `params[:oauth_verifier]` is the code you see on Vimeo after you visit `base.authorize_url` and allow access to your account.
140
+
136
141
  Now you've got everything you need to use the Advanced API. Let's get a user's videos:
137
142
 
138
143
  video = Vimeo::Advanced::Video.new("consumer_key", "consumer_secret", :token => user.token, :secret => user.secret)
139
- video.get_videos("matthooks")
144
+ video.get_all("matthooks")
140
145
 
141
146
  # => {"videos"=> { ... }, "stat"=>"ok", "generated_in"=>"0.5753"}
142
147
 
@@ -271,6 +276,7 @@ Some methods have optional variables. Pass these as a hash at the end of a call.
271
276
  video.get_cast("video_id", { :page => "1", :per_page => "25" })
272
277
  video.get_contacts_liked("user_id", { :page => "1", :per_page => "25", :full_response => "0", :sort => "newest" })
273
278
  video.get_contacts_uploaded("user_id", { :page => "1", :per_page => "25", :full_response => "0", :sort => "newest" })
279
+ video.get_collections("video_id")
274
280
  video.get_info("video_id")
275
281
  video.get_likes("user_id", { :page => "1", :per_page => "25", :full_response => "0", :sort => "newest" })
276
282
  video.get_subscriptions("user_id", { :page => "1", :per_page => "25", :full_response => "0", :sort => "newest" })
@@ -327,4 +333,4 @@ The upload method will automatically get an upload ticket, perform the multipart
327
333
  * [HTTParty](http://github.com/jnunemaker/httparty): Easily one of the best tools I have used since I started using Ruby.
328
334
  * [Jeweler](http://github.com/technicalpickles/jeweler): Great tool for creating gems for Github.
329
335
 
330
- ### Copyright (c) 2009-2010 Matt Hooks. See LICENSE for details.
336
+ ### Copyright (c) 2009-2010 Matt Hooks. See LICENSE for details.
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 5
4
- :patch: 1
4
+ :patch: 2
5
5
  :build: !!null
@@ -57,6 +57,10 @@ module Vimeo
57
57
  "vimeo.videos.getInfo",
58
58
  :required => [:video_id]
59
59
 
60
+ create_api_method :get_collections,
61
+ "vimeo.videos.getCollections",
62
+ :required => [:video_id]
63
+
60
64
  create_api_method :get_likes,
61
65
  "vimeo.videos.getLikes",
62
66
  :required => [:user_id],
@@ -0,0 +1,58 @@
1
+ {
2
+ "generated_in":"0.0352",
3
+ "stat":"ok",
4
+ "collections":{
5
+ "collection":[
6
+ {
7
+ "id":"238",
8
+ "name":"Paragliding",
9
+ "thumbnail":"http:\/\/b.vimeocdn.com\/ts\/271\/061\/271061013_200.jpg",
10
+ "type":"group"
11
+ },
12
+ {
13
+ "id":"69227",
14
+ "name":"ACRO PARAGLIDING",
15
+ "thumbnail":"http:\/\/b.vimeocdn.com\/ts\/269\/902\/269902809_200.jpg",
16
+ "type":"group"
17
+ },
18
+ {
19
+ "id":"3886",
20
+ "name":"Paragliding",
21
+ "thumbnail":"http:\/\/b.vimeocdn.com\/ts\/261\/654\/261654324_200.jpg",
22
+ "type":"channel"
23
+ },
24
+ {
25
+ "id":"246957",
26
+ "name":"Paragliding HD",
27
+ "thumbnail":"http:\/\/b.vimeocdn.com\/ts\/270\/993\/270993310_200.jpg",
28
+ "type":"channel"
29
+ },
30
+ {
31
+ "id":"61208",
32
+ "name":"VL",
33
+ "thumbnail":"http:\/\/b.vimeocdn.com\/ts\/252\/711\/252711076_200.jpg",
34
+ "type":"album"
35
+ }
36
+ ]
37
+ },
38
+ "urls":{
39
+ "url":[
40
+ {
41
+ "type":"group",
42
+ "_content":"http:\/\/vimeo.com\/groups\/paragliding\/videos\/38054508"
43
+ },
44
+ {
45
+ "type":"group",
46
+ "_content":"http:\/\/vimeo.com\/groups\/acroparagliding\/videos\/38054508"
47
+ },
48
+ {
49
+ "type":"channel",
50
+ "_content":"http:\/\/vimeo.com\/channels\/paragliding\/38054508"
51
+ },
52
+ {
53
+ "type":"channel",
54
+ "_content":"http:\/\/vimeo.com\/channels\/paraglidinghd\/38054508"
55
+ }
56
+ ]
57
+ }
58
+ }
@@ -85,6 +85,13 @@ class VideoTest < Test::Unit::TestCase
85
85
  assert_equal "ok", response["stat"]
86
86
  end
87
87
 
88
+ should "be able to get collections for a video" do
89
+ stub_post("?video_id=video_id&api_key=12345&format=json&method=vimeo.videos.getCollections&api_sig=0f1a7df7325961a0cf352da6264e913f", "advanced/video/get_collections.json")
90
+ response = @video.get_info("video_id")
91
+
92
+ assert_equal "ok", response["stat"]
93
+ end
94
+
88
95
  should "be able to get info about a video" do
89
96
  stub_post("?video_id=video_id&api_key=12345&format=json&method=vimeo.videos.getInfo&api_sig=0f1a7df7325961a0cf352da6264e913f", "advanced/video/get_info.json")
90
97
  response = @video.get_info("video_id")
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "vimeo"
8
- s.version = "1.5.1"
8
+ s.version = "1.5.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matt Hooks"]
12
- s.date = "2012-02-08"
12
+ s.date = "2012-03-29"
13
13
  s.description = "A full featured Ruby implementation of the Vimeo API."
14
14
  s.email = "matthooks@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -120,6 +120,7 @@ Gem::Specification.new do |s|
120
120
  "test/fixtures/advanced/video/get_appears_in.json",
121
121
  "test/fixtures/advanced/video/get_by_tag.json",
122
122
  "test/fixtures/advanced/video/get_cast.json",
123
+ "test/fixtures/advanced/video/get_collections.json",
123
124
  "test/fixtures/advanced/video/get_comments_list.json",
124
125
  "test/fixtures/advanced/video/get_contacts_liked.json",
125
126
  "test/fixtures/advanced/video/get_contacts_uploaded.json",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vimeo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-08 00:00:00.000000000Z
12
+ date: 2012-03-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda
16
- requirement: &2154460280 !ruby/object:Gem::Requirement
16
+ requirement: &2152842400 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.11.3
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2154460280
24
+ version_requirements: *2152842400
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: fakeweb
27
- requirement: &2154459800 !ruby/object:Gem::Requirement
27
+ requirement: &2152839400 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.2.6
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2154459800
35
+ version_requirements: *2152839400
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ruby-prof
38
- requirement: &2154459320 !ruby/object:Gem::Requirement
38
+ requirement: &2152836560 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.9.2
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2154459320
46
+ version_requirements: *2152836560
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: httparty
49
- requirement: &2154458820 !ruby/object:Gem::Requirement
49
+ requirement: &2152834460 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.4.5
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2154458820
57
+ version_requirements: *2152834460
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: json
60
- requirement: &2154458280 !ruby/object:Gem::Requirement
60
+ requirement: &2152832400 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.1.9
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2154458280
68
+ version_requirements: *2152832400
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: oauth
71
- requirement: &2154457780 !ruby/object:Gem::Requirement
71
+ requirement: &2152831240 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.4.3
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2154457780
79
+ version_requirements: *2152831240
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: httpclient
82
- requirement: &2154457280 !ruby/object:Gem::Requirement
82
+ requirement: &2152830480 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 2.1.5.2
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *2154457280
90
+ version_requirements: *2152830480
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: multipart-post
93
- requirement: &2154456780 !ruby/object:Gem::Requirement
93
+ requirement: &2152828980 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: 1.0.1
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *2154456780
101
+ version_requirements: *2152828980
102
102
  description: A full featured Ruby implementation of the Vimeo API.
103
103
  email: matthooks@gmail.com
104
104
  executables: []
@@ -210,6 +210,7 @@ files:
210
210
  - test/fixtures/advanced/video/get_appears_in.json
211
211
  - test/fixtures/advanced/video/get_by_tag.json
212
212
  - test/fixtures/advanced/video/get_cast.json
213
+ - test/fixtures/advanced/video/get_collections.json
213
214
  - test/fixtures/advanced/video/get_comments_list.json
214
215
  - test/fixtures/advanced/video/get_contacts_liked.json
215
216
  - test/fixtures/advanced/video/get_contacts_uploaded.json