onebox 1.8.61 → 1.8.62

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
- SHA256:
3
- metadata.gz: 4ff34d2d09c9f87a9061f22511b67db32547f05ace46cd93b7910c8bbb375ce2
4
- data.tar.gz: a3e4286602644a7cfa463e2a35ac5ff0a15509f7e90eecf49f33ac74d6802178
2
+ SHA1:
3
+ metadata.gz: 9519e506e1b016d8bd3729316a2245703e855c41
4
+ data.tar.gz: 146c1341db89704266842c7d0978430ac0255586
5
5
  SHA512:
6
- metadata.gz: d5116284c50bc2a976289770d13bc33ec2dbccb0d8c1ac6f641d6b63b7b7f633c4da3f1c2b2ab200585eb57ea06e68e72d07ff6a3996a1ad3c52ea308e47e4c0
7
- data.tar.gz: 2ee91162d0fa0874f774b32e39990b40f0e2fdb6ca440563a89cb9a2ca0438a6c83eda7c6c7786f5d2cbb9b4b251cec47cd76c0b04afc5209eee105fe45ce22c
6
+ metadata.gz: b6a8a234f6fd6088cd1c1e939ce514a3face9154be170d83b0b22af7ee847f3b42e4b8c4fc293d51cc04de44c4ff2222392bbe8da985ae7c9ee0a7e4fd18cf01
7
+ data.tar.gz: a56a1be9b7298df7a2d130b4359fe6b0075b489fb2adcb326676fa708fc426f94bdd7e8ad6c5814a7dd27b295f8789e7f0a018e447815f94fea730fb17bce1e8
@@ -157,6 +157,8 @@ module Onebox
157
157
  result[:description] = og[:description] || (summary && summary.inner_text)
158
158
  end
159
159
 
160
+ result[:price] = nil if result[:price] == "$0" || result[:price] == 0
161
+
160
162
  result
161
163
  end
162
164
  end
@@ -15,13 +15,13 @@ module Onebox
15
15
  private
16
16
 
17
17
  def data
18
+ price = raw.css("meta[itemprop=price]").first["content"] rescue "Free"
18
19
  result = {
19
20
  link: link,
20
- title: raw.css(".document-title div").inner_text,
21
- developer: raw.css(".document-subtitle.primary").inner_text,
22
- image: raw.css(".cover-image").first["src"],
23
- description: raw.css(".text-body div").inner_text[0..DEFAULTS[:MAX_DESCRIPTION_CHARS]].chop + "...",
24
- price: raw.css(".price.buy meta[itemprop=price]").first["content"]
21
+ title: raw.css("meta[property='og:title']").first["content"].gsub(" - Apps on Google Play", ""),
22
+ image: ::Onebox::Helpers.normalize_url_for_output(raw.css("meta[property='og:image']").first["content"]),
23
+ description: raw.css("meta[name=description]").first["content"][0..DEFAULTS[:MAX_DESCRIPTION_CHARS]].chop + "...",
24
+ price: price
25
25
  }
26
26
  if result[:price] == "0"
27
27
  result[:price] = "Free"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onebox
4
- VERSION = "1.8.61"
4
+ VERSION = "1.8.62"
5
5
  end
@@ -8,5 +8,5 @@
8
8
  {{#isbn_asin}}{{isbn_asin_text}}: {{isbn_asin}}, {{/isbn_asin}}
9
9
  {{#publisher}}{{publisher}}, {{/publisher}}
10
10
  {{#published}}{{published}}{{/published}}
11
- <strong>{{price}}</strong>
11
+ {{#price}}<strong>{{price}}</strong>{{/price}}
12
12
  </p>
@@ -1,5 +1,4 @@
1
1
  <h3>{{title}}</h3>
2
- <h4>{{developer}}</h4>
3
2
  <img src="{{image}}" class="thumbnail"/>
4
3
  <p>{{description}}</p>
5
4
  <em>{{price}}</em>
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.8.61
4
+ version: 1.8.62
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: 2018-09-19 00:00:00.000000000 Z
13
+ date: 2018-10-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -413,7 +413,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
413
413
  version: '0'
414
414
  requirements: []
415
415
  rubyforge_project:
416
- rubygems_version: 2.7.7
416
+ rubygems_version: 2.6.13
417
417
  signing_key:
418
418
  specification_version: 4
419
419
  summary: A gem for generating embeddable HTML previews from URLs.