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 CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -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
@@ -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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{viddlereo}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
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"]
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: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dan Pickett