videoclip 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.5
1
+ 0.2.6
@@ -0,0 +1,18 @@
1
+ module LaserLemon
2
+ module Videoclip
3
+ class Video::CollegeHumor < Video
4
+ def self.match?(uri)
5
+ (uri.host =~ /^(?:www\.)?collegehumor\.com$/i) && (uri.path =~ /^\/video:\d+/)
6
+ end
7
+
8
+ def assign(uri)
9
+ @key = uri.path.match(/^\/video:(\d+)/)[1]
10
+ @url = "http://www.collegehumor.com/video:#{@key}"
11
+ end
12
+
13
+ def embed(style = nil)
14
+ %(<object type="application/x-shockwave-flash" data="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=#{@key}&fullscreen=1" width="#{width(style)}" height="#{height(style)}" ><param name="allowfullscreen" value="true"/><param name="wmode" value="transparent"/><param name="allowScriptAccess" value="always"/><param name="movie" quality="best" value="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=#{@key}&fullscreen=1"/><embed src="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=#{@key}&fullscreen=1" type="application/x-shockwave-flash" wmode="transparent" width="#{width(style)}" height="#{height(style)}" allowScriptAccess="always"></embed></object>)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,23 @@
1
+ module LaserLemon
2
+ module Videoclip
3
+ class Video::DailyMotion < Video
4
+ def self.match?(uri)
5
+ (uri.host =~ /^(?:www\.)?dailymotion\.com$/i) && (uri.path =~ /\/video\/[^_]+_/)
6
+ end
7
+
8
+ def assign(uri)
9
+ @key = uri.path.match(/\/video\/([^_]+)_/)[1]
10
+ @url = "http://www.dailymotion.com/video/#{@key}"
11
+ end
12
+
13
+ def embed(style = nil)
14
+ %(<object width="#{width(style)}" height="#{height(style)}"><param name="movie" value="http://www.dailymotion.com/swf/#{@key}" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed src="http://www.dailymotion.com/swf/#{@key}" type="application/x-shockwave-flash" width="#{width(style)}" height="#{height(style)}" allowFullScreen="true" allowScriptAccess="always"></embed></object>)
15
+ end
16
+
17
+ protected
18
+ def chrome_height
19
+ 20
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ module LaserLemon
2
+ module Videoclip
3
+ class Video::LiveLeak < Video
4
+ def self.match?(uri)
5
+ (uri.host =~ /^(?:www\.)?liveleak\.com$/i) && (uri.path == '/view') && !CGI.parse(uri.query)['i'].blank?
6
+ end
7
+
8
+ def assign(uri)
9
+ @key = CGI.parse(uri.query)['i'].first
10
+ @url = "http://www.liveleak.com/view?i=#{@key}"
11
+ end
12
+
13
+ def embed(style = nil)
14
+ %(<object width="#{width(style)}" height="#{height(style)}"><param name="movie" value="http://www.liveleak.com/e/#{@key}"></param><param name="wmode" value="transparent"></param><embed src="http://www.liveleak.com/e/#{@key}" type="application/x-shockwave-flash" wmode="transparent" width="#{width(style)}" height="#{height(style)}"></embed></object>)
15
+ end
16
+
17
+ protected
18
+ def chrome_height
19
+ 20
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ module LaserLemon
2
+ module Videoclip
3
+ class Video::Metacafe < Video
4
+ def self.match?(uri)
5
+ (uri.host =~ /^(?:www\.)?metacafe\.com$/i) && (uri.path =~ /^\/watch\/\d+\//)
6
+ end
7
+
8
+ def assign(uri)
9
+ @key = uri.path.match(/^\/watch\/(\d+)\//)[1]
10
+ @url = "http://www.metacafe.com/videos/#{@key}"
11
+ end
12
+
13
+ def embed(style = nil)
14
+ %(<embed src="http://www.metacafe.com/fplayer/#{@key}/video.swf" width="#{width(style)}" height="#{height(style)}" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_#{@key}"></embed>)
15
+ end
16
+
17
+ protected
18
+ def chrome_height
19
+ 32
20
+ end
21
+ end
22
+ end
23
+ end
data/videoclip.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{videoclip}
8
- s.version = "0.2.5"
8
+ s.version = "0.2.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["laserlemon"]
12
- s.date = %q{2009-10-09}
12
+ s.date = %q{2009-10-10}
13
13
  s.description = %q{Save videos from popular sites alongside your ActiveRecord models}
14
14
  s.email = %q{steve@laserlemon.com}
15
15
  s.extra_rdoc_files = [
@@ -26,7 +26,11 @@ Gem::Specification.new do |s|
26
26
  "lib/videoclip.rb",
27
27
  "lib/videoclip/video.rb",
28
28
  "lib/videoclip/videos/blip.rb",
29
+ "lib/videoclip/videos/college_humor.rb",
30
+ "lib/videoclip/videos/daily_motion.rb",
29
31
  "lib/videoclip/videos/funny_or_die.rb",
32
+ "lib/videoclip/videos/live_leak.rb",
33
+ "lib/videoclip/videos/metacafe.rb",
30
34
  "lib/videoclip/videos/youtube.rb",
31
35
  "test/test_helper.rb",
32
36
  "test/videoclip_test.rb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: videoclip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - laserlemon
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-09 00:00:00 -04:00
12
+ date: 2009-10-10 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -32,7 +32,11 @@ files:
32
32
  - lib/videoclip.rb
33
33
  - lib/videoclip/video.rb
34
34
  - lib/videoclip/videos/blip.rb
35
+ - lib/videoclip/videos/college_humor.rb
36
+ - lib/videoclip/videos/daily_motion.rb
35
37
  - lib/videoclip/videos/funny_or_die.rb
38
+ - lib/videoclip/videos/live_leak.rb
39
+ - lib/videoclip/videos/metacafe.rb
36
40
  - lib/videoclip/videos/youtube.rb
37
41
  - test/test_helper.rb
38
42
  - test/videoclip_test.rb