acts_as_unvlogable 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +1 -1
- data/acts_as_unvlogable.gemspec +1 -0
- data/lib/acts_as_unvlogable.rb +2 -0
- data/lib/acts_as_unvlogable/version.rb +1 -1
- data/lib/acts_as_unvlogable/vg_11870.rb +1 -1
- data/lib/acts_as_unvlogable/vg_blip.rb +28 -28
- data/lib/acts_as_unvlogable/vg_dalealplay.rb +19 -3
- data/lib/acts_as_unvlogable/vg_vimeo.rb +1 -1
- data/spec/acts_as_unvlogable_spec.rb +19 -19
- metadata +34 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b25f375e3d2dc060e172cf163354f29a29b73a96
|
4
|
+
data.tar.gz: 8c625c22a281163acb560298056741e6270bcb10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8db16167584b6e00be1e57b40e5248645e6d0815230bcd8dd14368528591fac498924fa4fc3b18ed247e5a9defecf172ba2eb97760baf0fece3fd361d6b1608e
|
7
|
+
data.tar.gz: 1c4e49e5583e97bcc222e095d02daa3d6b2211ec9229dca72c233cbaf141afa38e04f70fc2e5919743ebbab88d4fe2828fda3c7a2d8df87a404bdfb44caf49d6
|
data/README.markdown
CHANGED
@@ -91,7 +91,7 @@ At this moment we support the following video services:
|
|
91
91
|
- [Metacafe](http://metacafe.com/)
|
92
92
|
- [Dailymotion](http://dailymotion.com/)
|
93
93
|
- [Collegehumor](http://collegehumor.com/)
|
94
|
-
- [Blip.tv](http://blip.tv/)
|
94
|
+
- ~~[Blip.tv](http://blip.tv/)~~ Transformed into maker.tv
|
95
95
|
- [Myspace](http://vids.myspace.com/)
|
96
96
|
- [Ted Talks](http://www.ted.com/talks/)
|
97
97
|
- [11870.com](http://11870.com/)
|
data/acts_as_unvlogable.gemspec
CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_development_dependency 'bundler', '~> 1.3'
|
24
24
|
s.add_development_dependency 'rake'
|
25
25
|
s.add_development_dependency 'rspec'
|
26
|
+
s.add_runtime_dependency("activesupport")
|
26
27
|
s.add_runtime_dependency("nokogiri")
|
27
28
|
s.add_runtime_dependency("xml-simple")
|
28
29
|
s.add_runtime_dependency("yt")
|
data/lib/acts_as_unvlogable.rb
CHANGED
@@ -4,40 +4,40 @@
|
|
4
4
|
# ----------------------------------------------
|
5
5
|
|
6
6
|
|
7
|
-
class VgBlip
|
7
|
+
# class VgBlip
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
# def initialize(url=nil, options={})
|
10
|
+
# @url = url.split("?").first if url
|
11
|
+
# res = Net::HTTP.get(URI.parse("#{url}?skin=rss"))
|
12
|
+
# @feed = REXML::Document.new(res)
|
13
|
+
# end
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
# def title
|
16
|
+
# CGI::unescape REXML::XPath.first(@feed, "//media:title")[0].to_s
|
17
|
+
# end
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
# def thumbnail
|
20
|
+
# REXML::XPath.first(@feed, "//media:thumbnail").attributes['url']
|
21
|
+
# end
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
# def duration
|
24
|
+
# nil
|
25
|
+
# end
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
# def embed_url
|
28
|
+
# emb = REXML::XPath.first(@feed, "//blip:embedUrl")[0].to_s
|
29
|
+
# end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
# def embed_html(width=425, height=344, options={}, params={})
|
32
|
+
# "<iframe src='#{embed_url}.x?p=1' width='#{width}' height='#{height}' frameborder='0' allowfullscreen></iframe>"
|
33
|
+
# end
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
# def download_url
|
36
|
+
# nil
|
37
|
+
# end
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
# def service
|
40
|
+
# "Blip.tv"
|
41
|
+
# end
|
42
42
|
|
43
|
-
end
|
43
|
+
# end
|
@@ -8,10 +8,10 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
class VgDalealplay
|
11
|
-
|
11
|
+
|
12
12
|
def initialize(url=nil, options={})
|
13
13
|
@url = url
|
14
|
-
@video_id = @url
|
14
|
+
@video_id = parse_url(@url)
|
15
15
|
@page = Nokogiri::HTML(open(@url))
|
16
16
|
end
|
17
17
|
|
@@ -20,7 +20,7 @@ class VgDalealplay
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def thumbnail
|
23
|
-
@page.xpath("//meta[@itemprop='
|
23
|
+
@page.xpath("//meta[@itemprop='thumbnailUrl']").first["content"]
|
24
24
|
end
|
25
25
|
|
26
26
|
def embed_url
|
@@ -42,5 +42,21 @@ class VgDalealplay
|
|
42
42
|
def service
|
43
43
|
"dalealplay"
|
44
44
|
end
|
45
|
+
|
46
|
+
def parse_url(url)
|
47
|
+
uri = URI.parse(url)
|
48
|
+
path = uri.path
|
49
|
+
videoargs = ''
|
50
|
+
if path
|
51
|
+
videoargs = path.split('_')[-1]
|
52
|
+
raise unless videoargs.size > 0
|
53
|
+
else
|
54
|
+
raise
|
55
|
+
end
|
56
|
+
videoargs
|
57
|
+
rescue
|
58
|
+
nil
|
59
|
+
end
|
60
|
+
|
45
61
|
|
46
62
|
end
|
@@ -19,7 +19,7 @@ describe UnvlogIt do
|
|
19
19
|
# ----------------------------------------------------------
|
20
20
|
|
21
21
|
context "with an existent youtube url" do
|
22
|
-
let(:videotron) { UnvlogIt.new("http://www.youtube.com/watch?v=MVa4q-YVjD8", {:key => "
|
22
|
+
let(:videotron) { UnvlogIt.new("http://www.youtube.com/watch?v=MVa4q-YVjD8", {:key => "AIzaSyAN2GQvZobD6qbsM0EI-Wy44LXVqbarz3Q" }) } # => Keith Moon´s drum kit explodes
|
23
23
|
|
24
24
|
it "initialize a VgYoutube instance" do
|
25
25
|
expect(VgYoutube).to eq(videotron.instance_values['object'].class)
|
@@ -35,18 +35,18 @@ describe UnvlogIt do
|
|
35
35
|
|
36
36
|
context "with an existent youtube url that can not be embedded" do
|
37
37
|
it {
|
38
|
-
expect { UnvlogIt.new("https://www.youtube.com/watch?v=-PZYZ6fJbr4", {:key => "
|
38
|
+
expect { UnvlogIt.new("https://www.youtube.com/watch?v=-PZYZ6fJbr4", {:key => "AIzaSyAN2GQvZobD6qbsM0EI-Wy44LXVqbarz3Q" }) }.to raise_error(ArgumentError, "Unsuported url or service")
|
39
39
|
}
|
40
40
|
end
|
41
41
|
|
42
42
|
context "with an inexistent youtube url" do
|
43
43
|
it {
|
44
|
-
expect { UnvlogIt.new("http://www.youtube.com/watch?v=inexistente", {:key => "
|
44
|
+
expect { UnvlogIt.new("http://www.youtube.com/watch?v=inexistente", {:key => "AIzaSyAN2GQvZobD6qbsM0EI-Wy44LXVqbarz3Q" }) }.to raise_error(ArgumentError, "Unsuported url or service")
|
45
45
|
}
|
46
46
|
end
|
47
47
|
|
48
48
|
context "with a shortened youtube URL" do
|
49
|
-
let(:videotron) { UnvlogIt.new("http://youtu.be/4pzMBtPMUq8", {:key => "
|
49
|
+
let(:videotron) { UnvlogIt.new("http://youtu.be/4pzMBtPMUq8", {:key => "AIzaSyAN2GQvZobD6qbsM0EI-Wy44LXVqbarz3Q" }) } # => Keith Moon´s drum kit explodes
|
50
50
|
|
51
51
|
it "initialize a VgYoutube instance" do
|
52
52
|
expect(VgYoutu).to eq(videotron.instance_values['object'].class)
|
@@ -81,7 +81,7 @@ describe UnvlogIt do
|
|
81
81
|
end
|
82
82
|
|
83
83
|
context "with an existent 'youtubed' metacafe url" do
|
84
|
-
let(:videotron) { UnvlogIt.new("http://www.metacafe.com/watch/yt-r07zdVLOWBA/pop_rocks_and_coke_myth/", {:key => "
|
84
|
+
let(:videotron) { UnvlogIt.new("http://www.metacafe.com/watch/yt-r07zdVLOWBA/pop_rocks_and_coke_myth/", {:key => "AIzaSyAN2GQvZobD6qbsM0EI-Wy44LXVqbarz3Q" }) } # => Pop Rocks and Coke Myth
|
85
85
|
|
86
86
|
it "initialize a VgMetacafe instance" do
|
87
87
|
expect(VgMetacafe).to eq(videotron.instance_values['object'].class)
|
@@ -135,22 +135,22 @@ describe UnvlogIt do
|
|
135
135
|
end
|
136
136
|
|
137
137
|
# ----------------------------------------------------------
|
138
|
-
# Testing blip.tv
|
138
|
+
# Testing blip.tv => transformed to maker TV
|
139
139
|
# ----------------------------------------------------------
|
140
140
|
|
141
|
-
context "with an existent blip.tv url" do
|
142
|
-
|
141
|
+
# context "with an existent blip.tv url" do
|
142
|
+
# let(:videotron) { UnvlogIt.new("http://blip.tv/sarahrdtv/sarah-s-super-bowl-spread-healthy-recipe-classic-buffalo-wing-dip-6717535") } # => Sarah's Super Bowl Spread – Healthy Recipe - Classic Buffalo Wing Dip
|
143
143
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
144
|
+
# it "initialize a VgBlip instance" do
|
145
|
+
# expect(VgBlip).to eq(videotron.instance_values['object'].class)
|
146
|
+
# expect("http://blip.tv/sarahrdtv/sarah-s-super-bowl-spread-healthy-recipe-classic-buffalo-wing-dip-6717535").to eq(videotron.instance_values['object'].instance_values['url'])
|
147
|
+
# expect(videotron.instance_values['object'].instance_values['feed']).to_not be_nil
|
148
|
+
# end
|
149
149
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
end
|
150
|
+
# it "returns the video properties" do
|
151
|
+
# check_video_attributes({:title => "Sarah's Super Bowl Spread – Healthy Recipe - Classic Buffalo Wing Dip", :service => "Blip.tv"})
|
152
|
+
# end
|
153
|
+
# end
|
154
154
|
|
155
155
|
# ----------------------------------------------------------
|
156
156
|
# Testing myspace.com
|
@@ -192,11 +192,11 @@ describe UnvlogIt do
|
|
192
192
|
# Testing dalealplay.com
|
193
193
|
# ----------------------------------------------------------
|
194
194
|
context "with an existent dalealplay.com url" do
|
195
|
-
let(:videotron) { UnvlogIt.new("http://www.dalealplay.
|
195
|
+
let(:videotron) { UnvlogIt.new("http://www.dalealplay.es/videos/CamelosSemos-Jonathan-Tu-si-que-vales_80280") } # => Camelos Semos Jonathan Tú si que vales
|
196
196
|
|
197
197
|
it "initialize a VgDalealplay instance" do
|
198
198
|
expect(VgDalealplay).to eq(videotron.instance_values['object'].class)
|
199
|
-
expect("http://www.dalealplay.
|
199
|
+
expect("http://www.dalealplay.es/videos/CamelosSemos-Jonathan-Tu-si-que-vales_80280").to eq(videotron.instance_values['object'].instance_values['url'])
|
200
200
|
expect("80280").to eq(videotron.instance_values['object'].instance_values['video_id'])
|
201
201
|
expect(videotron.instance_values['object'].instance_values['page']).to_not be_nil
|
202
202
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_unvlogable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Muñoz
|
@@ -10,90 +10,104 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2016-01-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '1.3'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '1.3'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rake
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - '>='
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '0'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - '>='
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rspec
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - '>='
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - '>='
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: activesupport
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
type: :runtime
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - '>='
|
55
69
|
- !ruby/object:Gem::Version
|
56
70
|
version: '0'
|
57
71
|
- !ruby/object:Gem::Dependency
|
58
72
|
name: nokogiri
|
59
73
|
requirement: !ruby/object:Gem::Requirement
|
60
74
|
requirements:
|
61
|
-
- -
|
75
|
+
- - '>='
|
62
76
|
- !ruby/object:Gem::Version
|
63
77
|
version: '0'
|
64
78
|
type: :runtime
|
65
79
|
prerelease: false
|
66
80
|
version_requirements: !ruby/object:Gem::Requirement
|
67
81
|
requirements:
|
68
|
-
- -
|
82
|
+
- - '>='
|
69
83
|
- !ruby/object:Gem::Version
|
70
84
|
version: '0'
|
71
85
|
- !ruby/object:Gem::Dependency
|
72
86
|
name: xml-simple
|
73
87
|
requirement: !ruby/object:Gem::Requirement
|
74
88
|
requirements:
|
75
|
-
- -
|
89
|
+
- - '>='
|
76
90
|
- !ruby/object:Gem::Version
|
77
91
|
version: '0'
|
78
92
|
type: :runtime
|
79
93
|
prerelease: false
|
80
94
|
version_requirements: !ruby/object:Gem::Requirement
|
81
95
|
requirements:
|
82
|
-
- -
|
96
|
+
- - '>='
|
83
97
|
- !ruby/object:Gem::Version
|
84
98
|
version: '0'
|
85
99
|
- !ruby/object:Gem::Dependency
|
86
100
|
name: yt
|
87
101
|
requirement: !ruby/object:Gem::Requirement
|
88
102
|
requirements:
|
89
|
-
- -
|
103
|
+
- - '>='
|
90
104
|
- !ruby/object:Gem::Version
|
91
105
|
version: '0'
|
92
106
|
type: :runtime
|
93
107
|
prerelease: false
|
94
108
|
version_requirements: !ruby/object:Gem::Requirement
|
95
109
|
requirements:
|
96
|
-
- -
|
110
|
+
- - '>='
|
97
111
|
- !ruby/object:Gem::Version
|
98
112
|
version: '0'
|
99
113
|
description: An easy way to include external video services in a rails app. This gem
|
@@ -107,9 +121,9 @@ executables: []
|
|
107
121
|
extensions: []
|
108
122
|
extra_rdoc_files: []
|
109
123
|
files:
|
110
|
-
-
|
111
|
-
-
|
112
|
-
-
|
124
|
+
- .coveralls.yml
|
125
|
+
- .gitignore
|
126
|
+
- .travis.yml
|
113
127
|
- Gemfile
|
114
128
|
- MIT-LICENSE
|
115
129
|
- README.markdown
|
@@ -148,17 +162,17 @@ require_paths:
|
|
148
162
|
- lib
|
149
163
|
required_ruby_version: !ruby/object:Gem::Requirement
|
150
164
|
requirements:
|
151
|
-
- -
|
165
|
+
- - '>='
|
152
166
|
- !ruby/object:Gem::Version
|
153
167
|
version: 1.9.3
|
154
168
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
169
|
requirements:
|
156
|
-
- -
|
170
|
+
- - '>='
|
157
171
|
- !ruby/object:Gem::Version
|
158
172
|
version: '0'
|
159
173
|
requirements: []
|
160
174
|
rubyforge_project: acts_as_unvlogable
|
161
|
-
rubygems_version: 2.
|
175
|
+
rubygems_version: 2.5.0
|
162
176
|
signing_key:
|
163
177
|
specification_version: 4
|
164
178
|
summary: An easy way to include external video services in a rails app
|