vimeo 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/CHANGELOG.rdoc +24 -0
- data/LICENSE +20 -0
- data/README.rdoc +322 -0
- data/Rakefile +68 -0
- data/VERSION.yml +4 -0
- data/lib/vimeo/advanced/album.rb +57 -0
- data/lib/vimeo/advanced/auth.rb +22 -0
- data/lib/vimeo/advanced/base.rb +105 -0
- data/lib/vimeo/advanced/channel.rb +58 -0
- data/lib/vimeo/advanced/contact.rb +31 -0
- data/lib/vimeo/advanced/group.rb +68 -0
- data/lib/vimeo/advanced/group_events.rb +25 -0
- data/lib/vimeo/advanced/group_forums.rb +19 -0
- data/lib/vimeo/advanced/person.rb +48 -0
- data/lib/vimeo/advanced/test.rb +36 -0
- data/lib/vimeo/advanced/upload.rb +62 -0
- data/lib/vimeo/advanced/video.rb +131 -0
- data/lib/vimeo/advanced/video_embed.rb +19 -0
- data/lib/vimeo/advanced.rb +20 -0
- data/lib/vimeo/simple/activity.rb +42 -0
- data/lib/vimeo/simple/album.rb +21 -0
- data/lib/vimeo/simple/base.rb +10 -0
- data/lib/vimeo/simple/channel.rb +21 -0
- data/lib/vimeo/simple/group.rb +28 -0
- data/lib/vimeo/simple/user.rb +84 -0
- data/lib/vimeo/simple/video.rb +14 -0
- data/lib/vimeo/simple.rb +14 -0
- data/lib/vimeo.rb +10 -0
- data/test/fixtures/advanced/album/add_video.json +4 -0
- data/test/fixtures/advanced/album/create.json +7 -0
- data/test/fixtures/advanced/album/delete.json +4 -0
- data/test/fixtures/advanced/album/get_all.json +111 -0
- data/test/fixtures/advanced/album/get_videos.json +30 -0
- data/test/fixtures/advanced/album/remove_video.json +4 -0
- data/test/fixtures/advanced/album/set_description.json +4 -0
- data/test/fixtures/advanced/album/set_password.json +4 -0
- data/test/fixtures/advanced/album/set_title.json +4 -0
- data/test/fixtures/advanced/auth/check_token.json +13 -0
- data/test/fixtures/advanced/auth/get_frob.json +5 -0
- data/test/fixtures/advanced/auth/get_token.json +13 -0
- data/test/fixtures/advanced/channel/add_video.json +4 -0
- data/test/fixtures/advanced/channel/get_all.json +1395 -0
- data/test/fixtures/advanced/channel/get_info.json +55 -0
- data/test/fixtures/advanced/channel/get_moderators.json +45 -0
- data/test/fixtures/advanced/channel/get_subscribers.json +44 -0
- data/test/fixtures/advanced/channel/get_videos.json +19 -0
- data/test/fixtures/advanced/channel/remove_video.json +4 -0
- data/test/fixtures/advanced/channel/subscribe.json +4 -0
- data/test/fixtures/advanced/channel/unsubscribe.json +4 -0
- data/test/fixtures/advanced/contact/get_all.json +117 -0
- data/test/fixtures/advanced/contact/get_mutual.json +80 -0
- data/test/fixtures/advanced/contact/get_online.json +47 -0
- data/test/fixtures/advanced/contact/get_who_added.json +117 -0
- data/test/fixtures/advanced/group/add_video.json +4 -0
- data/test/fixtures/advanced/group/get_all.json +1556 -0
- data/test/fixtures/advanced/group/get_files.json +255 -0
- data/test/fixtures/advanced/group/get_info.json +73 -0
- data/test/fixtures/advanced/group/get_members.json +862 -0
- data/test/fixtures/advanced/group/get_moderators.json +44 -0
- data/test/fixtures/advanced/group/get_video_comments.json +96 -0
- data/test/fixtures/advanced/group/get_videos.json +102 -0
- data/test/fixtures/advanced/group/join.json +4 -0
- data/test/fixtures/advanced/group/leave.json +4 -0
- data/test/fixtures/advanced/group_events/get_month.json +146 -0
- data/test/fixtures/advanced/group_events/get_past.json +146 -0
- data/test/fixtures/advanced/group_events/get_upcoming.json +146 -0
- data/test/fixtures/advanced/group_forums/get_topic_comments.json +224 -0
- data/test/fixtures/advanced/group_forums/get_topics.json +504 -0
- data/test/fixtures/advanced/person/add_contact.json +4 -0
- data/test/fixtures/advanced/person/add_subscription.json +4 -0
- data/test/fixtures/advanced/person/find_by_email.json +9 -0
- data/test/fixtures/advanced/person/get_hd_embeds.json +8 -0
- data/test/fixtures/advanced/person/get_info.json +21 -0
- data/test/fixtures/advanced/person/get_portrait_urls.json +28 -0
- data/test/fixtures/advanced/person/remove_contact.json +4 -0
- data/test/fixtures/advanced/person/remove_subscription.json +4 -0
- data/test/fixtures/advanced/test/echo.json +8 -0
- data/test/fixtures/advanced/test/login.json +8 -0
- data/test/fixtures/advanced/test/null.json +4 -0
- data/test/fixtures/advanced/upload/confirm.json +9 -0
- data/test/fixtures/advanced/upload/get_quota.json +16 -0
- data/test/fixtures/advanced/upload/get_ticket.json +8 -0
- data/test/fixtures/advanced/upload/manifest_to_upload.json +6 -0
- data/test/fixtures/advanced/upload/sample_iTunes.mov +0 -0
- data/test/fixtures/advanced/upload/verify_manifest.json +11 -0
- data/test/fixtures/advanced/video/add_cast.json +4 -0
- data/test/fixtures/advanced/video/add_comment.json +7 -0
- data/test/fixtures/advanced/video/add_photos.json +4 -0
- data/test/fixtures/advanced/video/add_tags.json +4 -0
- data/test/fixtures/advanced/video/clear_tags.json +4 -0
- data/test/fixtures/advanced/video/delete.json +4 -0
- data/test/fixtures/advanced/video/delete_comment.json +4 -0
- data/test/fixtures/advanced/video/edit_comment.json +4 -0
- data/test/fixtures/advanced/video/get_all.json +30 -0
- data/test/fixtures/advanced/video/get_appears_in.json +10 -0
- data/test/fixtures/advanced/video/get_by_tag.json +239 -0
- data/test/fixtures/advanced/video/get_cast.json +42 -0
- data/test/fixtures/advanced/video/get_comments_list.json +52 -0
- data/test/fixtures/advanced/video/get_contacts_liked.json +48 -0
- data/test/fixtures/advanced/video/get_contacts_uploaded.json +237 -0
- data/test/fixtures/advanced/video/get_info.json +246 -0
- data/test/fixtures/advanced/video/get_likes.json +32 -0
- data/test/fixtures/advanced/video/get_subscriptions.json +241 -0
- data/test/fixtures/advanced/video/get_thumbnail_urls.json +28 -0
- data/test/fixtures/advanced/video/get_uploaded.json +30 -0
- data/test/fixtures/advanced/video/remove_cast.json +4 -0
- data/test/fixtures/advanced/video/remove_tag.json +4 -0
- data/test/fixtures/advanced/video/search.json +238 -0
- data/test/fixtures/advanced/video/set_description.json +4 -0
- data/test/fixtures/advanced/video/set_like.json +4 -0
- data/test/fixtures/advanced/video/set_privacy.json +4 -0
- data/test/fixtures/advanced/video/set_title.json +4 -0
- data/test/fixtures/advanced/video_embed/get_presets.json +8 -0
- data/test/fixtures/advanced/video_embed/set_preset.json +4 -0
- data/test/fixtures/simple/activity/contacts_did.json +1 -0
- data/test/fixtures/simple/activity/everyone_did.json +1 -0
- data/test/fixtures/simple/activity/happened_to_contacts.json +1 -0
- data/test/fixtures/simple/activity/happened_to_user.json +1 -0
- data/test/fixtures/simple/activity/user_did.json +1 -0
- data/test/fixtures/simple/album/info.json +1 -0
- data/test/fixtures/simple/album/videos.json +1 -0
- data/test/fixtures/simple/channel/info.json +1 -0
- data/test/fixtures/simple/channel/videos.json +1 -0
- data/test/fixtures/simple/group/info.json +1 -0
- data/test/fixtures/simple/group/users.json +1 -0
- data/test/fixtures/simple/group/videos.json +1 -0
- data/test/fixtures/simple/user/albums.json +1 -0
- data/test/fixtures/simple/user/all_videos.json +1 -0
- data/test/fixtures/simple/user/appears_in.json +1 -0
- data/test/fixtures/simple/user/channels.json +1 -0
- data/test/fixtures/simple/user/contacts_like.json +1 -0
- data/test/fixtures/simple/user/contacts_videos.json +1 -0
- data/test/fixtures/simple/user/groups.json +1 -0
- data/test/fixtures/simple/user/info.json +1 -0
- data/test/fixtures/simple/user/likes.json +1 -0
- data/test/fixtures/simple/user/subscriptions.json +1 -0
- data/test/fixtures/simple/user/videos.json +1 -0
- data/test/fixtures/simple/video/info.json +1 -0
- data/test/test_helper.rb +50 -0
- data/test/vimeo/advanced/album_test.rb +88 -0
- data/test/vimeo/advanced/auth_test.rb +37 -0
- data/test/vimeo/advanced/base_test.rb +24 -0
- data/test/vimeo/advanced/channels_test.rb +79 -0
- data/test/vimeo/advanced/contacts_test.rb +40 -0
- data/test/vimeo/advanced/group_events_test.rb +33 -0
- data/test/vimeo/advanced/group_forums_test.rb +26 -0
- data/test/vimeo/advanced/groups_test.rb +82 -0
- data/test/vimeo/advanced/person_test.rb +68 -0
- data/test/vimeo/advanced/test_test.rb +33 -0
- data/test/vimeo/advanced/upload_test.rb +50 -0
- data/test/vimeo/advanced/videos_embed_test.rb +26 -0
- data/test/vimeo/advanced/videos_test.rb +203 -0
- data/test/vimeo/advanced_test.rb +0 -0
- data/test/vimeo/simple/activity_test.rb +60 -0
- data/test/vimeo/simple/album_test.rb +31 -0
- data/test/vimeo/simple/channel_test.rb +31 -0
- data/test/vimeo/simple/group_test.rb +41 -0
- data/test/vimeo/simple/user_test.rb +112 -0
- data/test/vimeo/simple/video_test.rb +22 -0
- data/test/vimeo/simple_test.rb +0 -0
- data/test/vimeo_test.rb +0 -0
- data/vimeo.gemspec +244 -0
- metadata +303 -0
@@ -0,0 +1,84 @@
|
|
1
|
+
module Vimeo
|
2
|
+
module Simple
|
3
|
+
|
4
|
+
class User < Vimeo::Simple::Base
|
5
|
+
# Returns a user's metadata.
|
6
|
+
#
|
7
|
+
# @param [String] username The user's id or username.
|
8
|
+
def self.info(username)
|
9
|
+
get("/#{username}/info.json")
|
10
|
+
end
|
11
|
+
|
12
|
+
# Returns a list of a user's videos.
|
13
|
+
#
|
14
|
+
# @param [String] username The user's id or username.
|
15
|
+
def self.videos(username)
|
16
|
+
get("/#{username}/videos.json")
|
17
|
+
end
|
18
|
+
|
19
|
+
# Returns a list of a user's liked videos.
|
20
|
+
#
|
21
|
+
# @param [String] username The user's id or username.
|
22
|
+
def self.likes(username)
|
23
|
+
get("/#{username}/likes.json")
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns a list of the videos a user appears in.
|
27
|
+
#
|
28
|
+
# @param [String] username The user's id or username.
|
29
|
+
def self.appears_in(username)
|
30
|
+
get("/#{username}/appears_in.json")
|
31
|
+
end
|
32
|
+
|
33
|
+
# Returns a list of all videos that are related to a user.
|
34
|
+
#
|
35
|
+
# @param [String] username The user's id or username.
|
36
|
+
def self.all_videos(username)
|
37
|
+
get("/#{username}/all_videos.json")
|
38
|
+
end
|
39
|
+
|
40
|
+
# Returns a list of a user's subscriptions.
|
41
|
+
#
|
42
|
+
# @param [String] username The user's id or username.
|
43
|
+
def self.subscriptions(username)
|
44
|
+
get("/#{username}/subscriptions.json")
|
45
|
+
end
|
46
|
+
|
47
|
+
# Returns a list of a user's albums.
|
48
|
+
#
|
49
|
+
# @param [String] username The user's id or username.
|
50
|
+
def self.albums(username)
|
51
|
+
get("/#{username}/albums.json")
|
52
|
+
end
|
53
|
+
|
54
|
+
# Returns a list of a user's channels.
|
55
|
+
#
|
56
|
+
# @param [String] username The user's id or username.
|
57
|
+
def self.channels(username)
|
58
|
+
get("/#{username}/channels.json")
|
59
|
+
end
|
60
|
+
|
61
|
+
# Returns a list of a user's groups.
|
62
|
+
#
|
63
|
+
# @param [String] username The user's id or username.
|
64
|
+
def self.groups(username)
|
65
|
+
get("/#{username}/groups.json")
|
66
|
+
end
|
67
|
+
|
68
|
+
# Returns a list of a user's contact's videos.
|
69
|
+
#
|
70
|
+
# @param [String] username The user's id or username.
|
71
|
+
def self.contacts_videos(username)
|
72
|
+
get("/#{username}/contacts_videos.json")
|
73
|
+
end
|
74
|
+
|
75
|
+
# Returns a list of videos that a user's contacts liked.
|
76
|
+
#
|
77
|
+
# @param [String] username The user's id or username.
|
78
|
+
def self.contacts_like(username)
|
79
|
+
get("/#{username}/contacts_like.json")
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
end # End Simple
|
84
|
+
end # End Vimeo
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Vimeo
|
2
|
+
module Simple
|
3
|
+
|
4
|
+
class Video < Vimeo::Simple::Base
|
5
|
+
# Returns this video's information.
|
6
|
+
#
|
7
|
+
# @param [String] video_id The video's id.
|
8
|
+
def self.info(video_id)
|
9
|
+
get("/video/#{video_id}.json")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end # End Simple
|
14
|
+
end # End Vimeo
|
data/lib/vimeo/simple.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__))
|
2
|
+
require 'simple/base'
|
3
|
+
require 'simple/activity'
|
4
|
+
require 'simple/album'
|
5
|
+
require 'simple/channel'
|
6
|
+
require 'simple/group'
|
7
|
+
require 'simple/user'
|
8
|
+
require 'simple/video'
|
9
|
+
|
10
|
+
module Vimeo
|
11
|
+
module Simple
|
12
|
+
|
13
|
+
end # Simple
|
14
|
+
end # Vimeo
|
data/lib/vimeo.rb
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
{
|
2
|
+
"generated_in":"0.6876",
|
3
|
+
"stat":"ok",
|
4
|
+
"albums":{
|
5
|
+
"on_this_page":"3",
|
6
|
+
"page":"1",
|
7
|
+
"perpage":"25",
|
8
|
+
"total":"3",
|
9
|
+
"album":[
|
10
|
+
{
|
11
|
+
"id":"129683",
|
12
|
+
"title":"Test Album Vimeo Gem",
|
13
|
+
"description":"Test",
|
14
|
+
"created_on":"2009-09-24 17:35:26",
|
15
|
+
"total_videos":"2",
|
16
|
+
"url":"http:\/\/vimeo.com\/album\/129683",
|
17
|
+
"video_sort_method":"arranged",
|
18
|
+
"thumbnail_video":{
|
19
|
+
"id":"2529363",
|
20
|
+
"owner":"888046",
|
21
|
+
"title":"Test Video",
|
22
|
+
"thumbnails":{
|
23
|
+
"thumbnail":[
|
24
|
+
{
|
25
|
+
"height":"75",
|
26
|
+
"width":"100",
|
27
|
+
"_content":"http:\/\/images.vimeo.com\/21\/88\/91\/218891849\/218891849_100.jpg"
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"height":"150",
|
31
|
+
"width":"200",
|
32
|
+
"_content":"http:\/\/images.vimeo.com\/21\/88\/91\/218891849\/218891849_200.jpg"
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"height":"480",
|
36
|
+
"width":"640",
|
37
|
+
"_content":"http:\/\/bitcast.vimeo.com\/vimeo\/thumbnails\/defaults\/default.300x400.jpg"
|
38
|
+
}
|
39
|
+
]
|
40
|
+
}
|
41
|
+
}
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"id":"129692",
|
45
|
+
"title":"Test Album Vimeo Gem22223",
|
46
|
+
"description":"Test",
|
47
|
+
"created_on":"2009-09-24 17:52:17",
|
48
|
+
"total_videos":"2",
|
49
|
+
"url":"http:\/\/vimeo.com\/album\/129692",
|
50
|
+
"video_sort_method":"arranged",
|
51
|
+
"thumbnail_video":{
|
52
|
+
"id":"2529363",
|
53
|
+
"owner":"888046",
|
54
|
+
"title":"Test Video",
|
55
|
+
"thumbnails":{
|
56
|
+
"thumbnail":[
|
57
|
+
{
|
58
|
+
"height":"75",
|
59
|
+
"width":"100",
|
60
|
+
"_content":"http:\/\/images.vimeo.com\/21\/88\/91\/218891849\/218891849_100.jpg"
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"height":"150",
|
64
|
+
"width":"200",
|
65
|
+
"_content":"http:\/\/images.vimeo.com\/21\/88\/91\/218891849\/218891849_200.jpg"
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"height":"480",
|
69
|
+
"width":"640",
|
70
|
+
"_content":"http:\/\/bitcast.vimeo.com\/vimeo\/thumbnails\/defaults\/default.300x400.jpg"
|
71
|
+
}
|
72
|
+
]
|
73
|
+
}
|
74
|
+
}
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"id":"129689",
|
78
|
+
"title":"Test Album Vimeo Gem21312",
|
79
|
+
"description":"Test",
|
80
|
+
"created_on":"2009-09-24 17:46:46",
|
81
|
+
"total_videos":"2",
|
82
|
+
"url":"http:\/\/vimeo.com\/album\/129689",
|
83
|
+
"video_sort_method":"arranged",
|
84
|
+
"thumbnail_video":{
|
85
|
+
"id":"2529363",
|
86
|
+
"owner":"888046",
|
87
|
+
"title":"Test Video",
|
88
|
+
"thumbnails":{
|
89
|
+
"thumbnail":[
|
90
|
+
{
|
91
|
+
"height":"75",
|
92
|
+
"width":"100",
|
93
|
+
"_content":"http:\/\/images.vimeo.com\/21\/88\/91\/218891849\/218891849_100.jpg"
|
94
|
+
},
|
95
|
+
{
|
96
|
+
"height":"150",
|
97
|
+
"width":"200",
|
98
|
+
"_content":"http:\/\/images.vimeo.com\/21\/88\/91\/218891849\/218891849_200.jpg"
|
99
|
+
},
|
100
|
+
{
|
101
|
+
"height":"480",
|
102
|
+
"width":"640",
|
103
|
+
"_content":"http:\/\/bitcast.vimeo.com\/vimeo\/thumbnails\/defaults\/default.300x400.jpg"
|
104
|
+
}
|
105
|
+
]
|
106
|
+
}
|
107
|
+
}
|
108
|
+
}
|
109
|
+
]
|
110
|
+
}
|
111
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"generated_in":"0.2487",
|
3
|
+
"stat":"ok",
|
4
|
+
"videos":{
|
5
|
+
"on_this_page":"2",
|
6
|
+
"page":"1",
|
7
|
+
"perpage":"25",
|
8
|
+
"total":"2",
|
9
|
+
"video":[
|
10
|
+
{
|
11
|
+
"embed_privacy":"anywhere",
|
12
|
+
"id":"411684",
|
13
|
+
"is_hd":"1",
|
14
|
+
"owner":"151382",
|
15
|
+
"privacy":"anybody",
|
16
|
+
"title":"my home (minn heima)",
|
17
|
+
"upload_date":"2007-12-01 16:11:19"
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"embed_privacy":"anywhere",
|
21
|
+
"id":"2529363",
|
22
|
+
"is_hd":"0",
|
23
|
+
"owner":"888046",
|
24
|
+
"privacy":"anybody",
|
25
|
+
"title":"Test Video",
|
26
|
+
"upload_date":"2008-12-14 23:57:19"
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
}
|