video_info 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/provider/youtube.rb +1 -1
- data/spec/video_info_spec.rb +8 -0
- data/video_info.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.2
|
data/lib/provider/youtube.rb
CHANGED
|
@@ -20,7 +20,7 @@ private
|
|
|
20
20
|
@title = doc.search("media:title").inner_text
|
|
21
21
|
@description = doc.search("media:description").inner_text
|
|
22
22
|
@keywords = doc.search("media:keywords").inner_text
|
|
23
|
-
@duration = doc.search("
|
|
23
|
+
@duration = doc.search("yt:duration").first[:seconds].to_i
|
|
24
24
|
@date = Time.parse(doc.search("published").inner_text, Time.now.utc)
|
|
25
25
|
@thumbnail_small = doc.search("media:thumbnail").first[:url]
|
|
26
26
|
@thumbnail_large = doc.search("media:thumbnail").last[:url]
|
data/spec/video_info_spec.rb
CHANGED
|
@@ -20,6 +20,14 @@ describe "VideoInfo" do
|
|
|
20
20
|
it { should be_valid }
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
describe "from Youtube" do
|
|
24
|
+
subject { VideoInfo.new('http://www.youtube.com/watch?v=JM9NgvjjVng') }
|
|
25
|
+
|
|
26
|
+
its(:provider) { should == 'YouTube' }
|
|
27
|
+
its(:duration) { should == 217 }
|
|
28
|
+
it { should be_valid }
|
|
29
|
+
end
|
|
30
|
+
|
|
23
31
|
describe "from Vimeo" do
|
|
24
32
|
subject { VideoInfo.new('http://www.vimeo.com/898029') }
|
|
25
33
|
|
data/video_info.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{video_info}
|
|
8
|
-
s.version = "0.2.
|
|
8
|
+
s.version = "0.2.2"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Thibaud Guillaume-Gentil"]
|
|
12
|
-
s.date = %q{2009-
|
|
12
|
+
s.date = %q{2009-12-04}
|
|
13
13
|
s.description = %q{Get video info from youtube and vimeo url.}
|
|
14
14
|
s.email = %q{thibaud@thibaud.me}
|
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: video_info
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thibaud Guillaume-Gentil
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-
|
|
12
|
+
date: 2009-12-04 00:00:00 +01:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|