onebox 1.5.26 → 1.5.27
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/google_calendar_onebox.rb +1 -1
- data/lib/onebox/engine/imgur_onebox.rb +1 -1
- data/lib/onebox/engine/whitelisted_generic_onebox.rb +5 -1
- data/lib/onebox/version.rb +1 -1
- data/onebox.gemspec +1 -0
- data/templates/whitelistedgeneric.mustache +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58182bba2fd139c8beccf6360c69b9d77da12145
|
4
|
+
data.tar.gz: 4a5eaeb8eccb8847fe7d91f4fa708802f3d9067d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5442a57cd27a042fbc57d187c2918dcf0e688cd9bd3bbafa4511d31fbf026d789cab4b834be43b653f058a79b82fb1d4abc4702d76f824075142d2a6dcd9f20c
|
7
|
+
data.tar.gz: b139cba62ebb754cc7d508811f36800dd27ac5a6426a97f25a166031b56020ad503b2160245b54411f90e87a358981799594dfa28e1b9c4391f1cbf9614a97a3
|
@@ -11,7 +11,7 @@ module Onebox
|
|
11
11
|
imgur_data = get_imgur_data
|
12
12
|
return "<video width='#{imgur_data[:"player:width"]}' height='#{imgur_data[:"player:height"]}' controls autoplay loop><source src='#{imgur_data[:"player:stream"]}' type='video/mp4'><source src='#{imgur_data[:"player:stream"].gsub('mp4', 'webm')}' type='video/webm'></video>" if imgur_data[:"player:stream"]
|
13
13
|
return "<a href='#{url}' target='_blank'><img src='#{imgur_data[:image]}' alt='Imgur' height='#{imgur_data[:"image:height"]}' width='#{imgur_data[:"image:width"]}'></a>" if imgur_data[:image]
|
14
|
-
return "<div><a href='#{url}' target='_blank'><
|
14
|
+
return "<div class='onebox imgur-album'><a href='#{url}' target='_blank'><span class='outer-box'><span class='inner-box'><span class='album-title'>[Album] #{imgur_data[:title]}</span></span></span><img src='#{imgur_data[:"image0:src"]}' alt='Imgur'></a></div>" if imgur_data[:"image0:src"]
|
15
15
|
return nil
|
16
16
|
end
|
17
17
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'htmlentities'
|
2
|
+
|
1
3
|
module Onebox
|
2
4
|
module Engine
|
3
5
|
class WhitelistedGenericOnebox
|
@@ -34,6 +36,7 @@ module Onebox
|
|
34
36
|
cnn.com
|
35
37
|
collegehumor.com
|
36
38
|
coursera.org
|
39
|
+
codepen.io
|
37
40
|
cracked.com
|
38
41
|
dailymail.co.uk
|
39
42
|
dailymotion.com
|
@@ -228,10 +231,11 @@ module Onebox
|
|
228
231
|
def data
|
229
232
|
if raw.is_a?(Hash)
|
230
233
|
raw[:link] ||= link
|
234
|
+
raw[:title] = HTMLEntities.new.decode(raw[:title])
|
231
235
|
return raw
|
232
236
|
end
|
233
237
|
|
234
|
-
data_hash = { link: link, title: raw.title, description: raw.description }
|
238
|
+
data_hash = { link: link, title: HTMLEntities.new.decode(raw.title), description: raw.description }
|
235
239
|
data_hash[:image] = raw.images.first if raw.images && raw.images.first
|
236
240
|
data_hash[:type] = raw.type if raw.type
|
237
241
|
|
data/lib/onebox/version.rb
CHANGED
data/onebox.gemspec
CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_runtime_dependency 'mustache'
|
23
23
|
spec.add_runtime_dependency 'nokogiri', '~> 1.6.6'
|
24
24
|
spec.add_runtime_dependency 'moneta', '~> 0.8'
|
25
|
+
spec.add_runtime_dependency 'htmlentities', '~> 4.3.4'
|
25
26
|
|
26
27
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
27
28
|
spec.add_development_dependency 'rake', '~> 10.4'
|
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.27
|
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-
|
13
|
+
date: 2015-11-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: multi_json
|
@@ -68,6 +68,20 @@ dependencies:
|
|
68
68
|
- - "~>"
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0.8'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: htmlentities
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - "~>"
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 4.3.4
|
78
|
+
type: :runtime
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - "~>"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 4.3.4
|
71
85
|
- !ruby/object:Gem::Dependency
|
72
86
|
name: bundler
|
73
87
|
requirement: !ruby/object:Gem::Requirement
|