onebox 1.6.7 → 1.6.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onebox/engine/standard_embed.rb +16 -10
- data/lib/onebox/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a12d23bfa68fd516d78c674b2ad5918197b562aa
|
4
|
+
data.tar.gz: d7da2b8da8e5155e30ae469470e8054603314b5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6600bba536e0e346696272c3cabfed3f946a0a7596e8400b25c76d727a31efea9209bc88fb8b08d4933467085d7a267f3b6e963afc91a48dbe77a2f8f938f39
|
7
|
+
data.tar.gz: 5eeb57535bdd8d624b417458890d4f5a5efa8b74d624b0519d001bfff85f9038d81d32920bc7a0f4782810697b0887ce4db344ffaf90b6406aa77efa3ff93218
|
@@ -20,6 +20,8 @@ module Onebox
|
|
20
20
|
|
21
21
|
# Some oembed providers (like meetup.com) don't provide links to themselves
|
22
22
|
add_oembed_provider(/www\.meetup\.com\//, 'http://api.meetup.com/oembed')
|
23
|
+
# In order to support Private Videos
|
24
|
+
add_oembed_provider(/vimeo\.com\//, 'https://vimeo.com/api/oembed.json')
|
23
25
|
|
24
26
|
def always_https?
|
25
27
|
WhitelistedGenericOnebox.host_matches(uri, WhitelistedGenericOnebox.https_hosts) || super
|
@@ -50,19 +52,23 @@ module Onebox
|
|
50
52
|
end
|
51
53
|
|
52
54
|
def get_oembed
|
53
|
-
|
54
|
-
oembed_url = application_json.value if application_json
|
55
|
+
oembed_url = nil
|
55
56
|
|
56
|
-
|
57
|
-
|
57
|
+
StandardEmbed.oembed_providers.each do |regexp, endpoint|
|
58
|
+
if url =~ regexp
|
59
|
+
oembed_url = "#{endpoint}?url=#{url}"
|
60
|
+
break
|
61
|
+
end
|
62
|
+
end
|
58
63
|
|
59
64
|
if Onebox::Helpers.blank?(oembed_url)
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
65
|
+
application_json = html_doc.at("//link[@type='application/json+oembed']/@href")
|
66
|
+
oembed_url = application_json.value if application_json
|
67
|
+
end
|
68
|
+
|
69
|
+
if Onebox::Helpers.blank?(oembed_url)
|
70
|
+
text_json = html_doc.at("//link[@type='text/json+oembed']/@href")
|
71
|
+
oembed_url ||= text_json.value if text_json
|
66
72
|
end
|
67
73
|
|
68
74
|
return {} if Onebox::Helpers.blank?(oembed_url)
|
data/lib/onebox/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onebox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joanna Zeta
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-12-
|
13
|
+
date: 2016-12-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: multi_json
|
@@ -528,4 +528,3 @@ test_files:
|
|
528
528
|
- spec/lib/onebox_spec.rb
|
529
529
|
- spec/spec_helper.rb
|
530
530
|
- spec/support/html_spec_helper.rb
|
531
|
-
has_rdoc:
|