onebox 1.5.28 → 1.5.29
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a71d37f0f18224ffa7a1161bb5fc58c53f42fc75
|
4
|
+
data.tar.gz: 90800a259664e555697a877640a2ac8df6808c4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 458dcddb5eff58050b98c494d91d07bf374c9bf93fe74885e7bd367c76e52cef590bb2d52ea9636e8d03017b16746fd1621d692e537b0ed23d98afadd9c8a4a7
|
7
|
+
data.tar.gz: bf58d969638057be027a8e4f87dd7fea74cf4bc5886d588e64e616b7cd2e413f8d0eba3f0408410f45b0fbbc46795a05e40db68acbefdf57e5112afdfd2e4e19
|
@@ -8,7 +8,8 @@ module Onebox
|
|
8
8
|
always_https
|
9
9
|
|
10
10
|
def to_html
|
11
|
-
get_oembed_data[:html]
|
11
|
+
oembed_data = get_oembed_data[:html]
|
12
|
+
oembed_data.gsub!('visual=true', 'visual=false') || oembed_data
|
12
13
|
end
|
13
14
|
|
14
15
|
def placeholder_html
|
@@ -17,8 +18,16 @@ module Onebox
|
|
17
18
|
|
18
19
|
private
|
19
20
|
|
21
|
+
def set?
|
22
|
+
url =~ /\/sets\//
|
23
|
+
end
|
24
|
+
|
20
25
|
def get_oembed_data
|
21
|
-
|
26
|
+
if set?
|
27
|
+
Onebox::Helpers.symbolize_keys(::MultiJson.load(Onebox::Helpers.fetch_response("https://soundcloud.com/oembed.json?url=#{url}").body))
|
28
|
+
else
|
29
|
+
Onebox::Helpers.symbolize_keys(::MultiJson.load(Onebox::Helpers.fetch_response("https://soundcloud.com/oembed.json?url=#{url}&maxheight=166").body))
|
30
|
+
end
|
22
31
|
end
|
23
32
|
end
|
24
33
|
end
|
@@ -239,7 +239,9 @@ module Onebox
|
|
239
239
|
data_hash[:image] = raw.images.first if raw.images && raw.images.first
|
240
240
|
data_hash[:type] = raw.type if raw.type
|
241
241
|
|
242
|
-
if raw.metadata && raw.metadata[:video] && raw.metadata[:video].first
|
242
|
+
if raw.metadata && raw.metadata[:"video:secure_url"] && raw.metadata[:"video:secure_url"].first
|
243
|
+
data_hash[:video] = raw.metadata[:"video:secure_url"].first
|
244
|
+
elsif raw.metadata && raw.metadata[:video] && raw.metadata[:video].first
|
243
245
|
data_hash[:video] = raw.metadata[:video].first
|
244
246
|
end
|
245
247
|
|
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.5.
|
4
|
+
version: 1.5.29
|
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: 2015-11
|
13
|
+
date: 2015-12-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: multi_json
|
@@ -431,7 +431,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
431
431
|
version: '0'
|
432
432
|
requirements: []
|
433
433
|
rubyforge_project:
|
434
|
-
rubygems_version: 2.4.
|
434
|
+
rubygems_version: 2.4.8
|
435
435
|
signing_key:
|
436
436
|
specification_version: 4
|
437
437
|
summary: A gem for turning URLs into previews.
|
@@ -488,3 +488,4 @@ test_files:
|
|
488
488
|
- spec/lib/onebox_spec.rb
|
489
489
|
- spec/spec_helper.rb
|
490
490
|
- spec/support/html_spec_helper.rb
|
491
|
+
has_rdoc:
|