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: 093e38bc01cea645ba23458783b5241c1dc6b07a
4
- data.tar.gz: 6cb6ee768bc2d23584d607eabe906dd69b4ac2bc
3
+ metadata.gz: a71d37f0f18224ffa7a1161bb5fc58c53f42fc75
4
+ data.tar.gz: 90800a259664e555697a877640a2ac8df6808c4f
5
5
  SHA512:
6
- metadata.gz: 88823288324ddc7a9ad375d5694563cd6ada8dd4524344c7f9c2cfa36f45dd8dd82ee1ecf99bfa3a742333a07440245693d98ae524e76981f99b6a86ca68de3e
7
- data.tar.gz: 013064b0aedd3086abcd8a7f36d81fc205191941524e6a5897e8549dcfda5890bda58cffdc022cfee3c4838a2564b9e63c9a2da7a7e8601e46a8e54750bbaa49
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].gsub!('height="400"', 'height="250"')
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
- Onebox::Helpers.symbolize_keys(::MultiJson.load(Onebox::Helpers.fetch_response("https://soundcloud.com/oembed.json?url=#{url}").body))
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
 
@@ -1,3 +1,3 @@
1
1
  module Onebox
2
- VERSION = "1.5.28"
2
+ VERSION = "1.5.29"
3
3
  end
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.28
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-19 00:00:00.000000000 Z
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.5.1
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: