onebox 1.5.61 → 1.5.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
2
  SHA1:
3
- metadata.gz: 6e679c5ee06dec67d693d09cec310dbfdd08dd45
4
- data.tar.gz: e0735b4905d8c3783c3afdcba33de765d09df021
3
+ metadata.gz: e4969ae9933bb333861d909df2089075648c2963
4
+ data.tar.gz: 7eb13f7b5c2e8a37c43af1a56b138737c05ec16f
5
5
  SHA512:
6
- metadata.gz: 7250b319e3f358b0d2dcc4c2a7d3f5ef7e428ab0f2887f0888c08729fff498145512ba058a1a32ceb50c597d9c3689e57ffe424b25f1524abf4780554fa890dd
7
- data.tar.gz: dfef8ef79e658734722ab967d8e76dd92b2f6bc559fed63a62441f45a211dd203cfb6e70d70b5ec12226ab2958b1fee6b617dfe24e2fce8cc1e49f8ab8ba9d39
6
+ metadata.gz: 7e2f1e665e5e62efb3cf32cc24ec61f06da47e89cdbc2db5ae3be7e436b9446b7d3eb9d0676b3af7537ff1c11c676c7653d733378c85b1a3739a328aa9cb3caa
7
+ data.tar.gz: 4e43bc28d5ef4f0d60a7c11f25b57c9809774fb8ab7c594d435fcb8e2eceb472365a9ae20681f35d374272f99feec154e52481e63cf262dc3eca96a5d906f8ba
@@ -76,12 +76,17 @@ module Onebox
76
76
  og = {}
77
77
 
78
78
  html_doc.css('meta').each do |m|
79
- if m["property"] && m["property"][/^og:(.+)$/i]
80
- value = m["content"].to_s
79
+ if (m["property"] && m["property"][/^og:(.+)$/i]) || (m["name"] && m["name"][/^og:(.+)$/i])
80
+ value = (m["content"] || m["value"]).to_s
81
81
  og[$1.tr('-:','_').to_sym] ||= value unless Onebox::Helpers::blank?(value)
82
82
  end
83
83
  end
84
84
 
85
+ # Attempt to retrieve the title from the meta tag
86
+ if title = html_doc.at_css('title').try(:text)
87
+ og[:title] ||= title unless Onebox::Helpers.blank?(title)
88
+ end
89
+
85
90
  og
86
91
  end
87
92
 
@@ -89,7 +94,7 @@ module Onebox
89
94
  twitter = {}
90
95
 
91
96
  html_doc.css('meta').each do |m|
92
- if m["name"] && m["name"][/^twitter:(.+)$/i]
97
+ if (m["property"] && m["property"][/^twitter:(.+)$/i]) || (m["name"] && m["name"][/^twitter:(.+)$/i])
93
98
  value = (m["content"] || m["value"]).to_s
94
99
  twitter[$1.tr('-:','_').to_sym] ||= value unless Onebox::Helpers::blank?(value)
95
100
  end
@@ -1,3 +1,3 @@
1
1
  module Onebox
2
- VERSION = "1.5.61"
2
+ VERSION = "1.5.62"
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.61
4
+ version: 1.5.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: 2016-11-06 00:00:00.000000000 Z
13
+ date: 2016-11-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -506,4 +506,3 @@ test_files:
506
506
  - spec/lib/onebox_spec.rb
507
507
  - spec/spec_helper.rb
508
508
  - spec/support/html_spec_helper.rb
509
- has_rdoc: