onebox 1.9.22 → 1.9.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1fb31a47513559987d7a7ed700b50c6da4b1d1c837e8faf3771275699522910
4
- data.tar.gz: d51ce8a6d1407f4c0fca90966c1583b91e2c0537e55971c61b12f16668f7d4d2
3
+ metadata.gz: c59fdb0a75faf98373d219999658d29423c81273fc2540b288721e083261d000
4
+ data.tar.gz: 842cfdd7957c5fd862ec7ed7931d5d61adf96656577bb2fe3c837dff436e4e57
5
5
  SHA512:
6
- metadata.gz: a55a964633b58b1e8831db55737cbe3aaca13531a2f889f53280c81b8d954a4983b0f6c20025f1ab64d5b26e6b45c48c024fbc46d5df72b2846bbcfc60b0b6c0
7
- data.tar.gz: b75844882c10d7149eb19f967c74ad600279d9f3e8bf91036def27a7e2c45d31dafeab354b6180ffdce849900a13bd4f80d596cb7af950facba4ef11cecd363c
6
+ metadata.gz: 67c38c486f923c0dece67558435c43b0f80759e5020a360a726087b211eb17ffe932df872fd1d61f615935e32559ad895f7dcf05c48820d1720efd0b14b821d7
7
+ data.tar.gz: 3dff1e9e38bf2a4a9940688f5399e851ce9ee5607ab917caf41a2435e01cfccda13808959fd8e804e3e1c39a3cef4579bd85f2ddfc68ac02bc129dd4a33053e5
@@ -35,7 +35,7 @@ module Onebox
35
35
  private
36
36
 
37
37
  def match
38
- @match ||= @url.match(/(?:d|g)p\/(?:product\/)?(?<id>[^\/]+)(?:\/|$)/mi)
38
+ @match ||= @url.match(/(?:d|g)p\/(?:product\/|video\/detail\/)?(?<id>[^\/]+)(?:\/|$)/mi)
39
39
  end
40
40
 
41
41
  def image
@@ -157,7 +157,7 @@ module Onebox
157
157
  result[:by_info] = Onebox::Helpers.clean(result[:by_info].inner_html) if result[:by_info]
158
158
 
159
159
  summary = raw.at("#productDescription")
160
- result[:description] = og.description || (summary && summary.inner_text)
160
+ result[:description] = og.description || (summary && summary.inner_text) || CGI.unescapeHTML(Onebox::Helpers.truncate(raw.css("meta[name=description]").first["content"], 250))
161
161
  end
162
162
 
163
163
  result[:price] = nil if result[:price].start_with?("$0") || result[:price] == 0
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onebox
4
- VERSION = "1.9.22"
4
+ VERSION = "1.9.23"
5
5
  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.9.22
4
+ version: 1.9.23
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: 2019-11-07 00:00:00.000000000 Z
13
+ date: 2019-11-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json