viddlereo 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/viddlereo/playlist.rb +1 -0
- data/lib/viddlereo/video.rb +17 -0
- data/viddlereo.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/lib/viddlereo/playlist.rb
CHANGED
@@ -41,6 +41,7 @@ module Viddlereo
|
|
41
41
|
response = get(:method => :getDetails,
|
42
42
|
:playlist_id => playlist_id,
|
43
43
|
:per_page => options[:per_page] || 100,
|
44
|
+
:add_embed_code => options[:add_embed_code] || 1,
|
44
45
|
:page => options[:page] || 1)
|
45
46
|
playlist = parse(response).first
|
46
47
|
playlist.videos = Viddlereo::Video.parse(response) if playlist
|
data/lib/viddlereo/video.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
module Viddlereo
|
2
2
|
class Video < Resource
|
3
|
+
auth_required
|
4
|
+
resource_name "videos"
|
5
|
+
|
3
6
|
element :id, String
|
4
7
|
element :status, String
|
5
8
|
element :author, String
|
@@ -16,5 +19,19 @@ module Viddlereo
|
|
16
19
|
element :favorite, Boolean
|
17
20
|
element :comment_count, Integer
|
18
21
|
element :embed_code, String
|
22
|
+
|
23
|
+
def self.find_by_id(identifier, options = {})
|
24
|
+
response = get(:method => :getDetails,
|
25
|
+
:video_id => identifier,
|
26
|
+
:add_embed_code => options[:add_embed_code] || 1)
|
27
|
+
video = parse(response)
|
28
|
+
end
|
29
|
+
|
30
|
+
def get_embed_code(options = {})
|
31
|
+
response = self.class.get(:method => :getEmbedCode,
|
32
|
+
:video_id => self.id,
|
33
|
+
:embed_code => options[:embed_code] || 3)
|
34
|
+
self.embed_code = self.class.parse(response).embed_code
|
35
|
+
end
|
19
36
|
end
|
20
37
|
end
|
data/viddlereo.gemspec
CHANGED
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:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dan Pickett
|