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 +4 -4
- data/lib/onebox/engine/standard_embed.rb +8 -3
- data/lib/onebox/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4969ae9933bb333861d909df2089075648c2963
|
4
|
+
data.tar.gz: 7eb13f7b5c2e8a37c43af1a56b138737c05ec16f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.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-
|
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:
|