onebox 1.6.0 → 1.6.1
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.rb +1 -0
- data/lib/onebox/engine/steam_store_onebox.rb +36 -0
- data/lib/onebox/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9568d4cc0a0bf144ffe61a5b97973f44e41c941f
|
4
|
+
data.tar.gz: 098b322abd9e0b5941124a22d14e83be9a29d2e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 801755ee7531576bd9e006f06563d97d2540ed58be765668bef94d7c56a61e345a5579450089c86566cdb2fdd45c62a8c15732a9f5fdc14b8ebc4f27c939fb90
|
7
|
+
data.tar.gz: ed306b576710b9b63a792b8964b2a91ee3b822fc142dd75c71501f9db9216d3e14c5cbf554aa091248d59d1704eab05bf96684f691e1ed51b2cb9f3b7fe9f419
|
data/lib/onebox/engine.rb
CHANGED
@@ -0,0 +1,36 @@
|
|
1
|
+
module Onebox
|
2
|
+
module Engine
|
3
|
+
class SteamStoreOnebox
|
4
|
+
include Engine
|
5
|
+
include StandardEmbed
|
6
|
+
|
7
|
+
always_https
|
8
|
+
matches_regexp(/^https?:\/\/store\.steampowered\.com\/app\/\d+/)
|
9
|
+
|
10
|
+
def placeholder_html
|
11
|
+
og = get_opengraph
|
12
|
+
<<-HTML
|
13
|
+
<div style='width:100%; height:190px; background-color:#262626; color:#9e9e9e; margin:15px 0;'>
|
14
|
+
<div style='padding:10px'>
|
15
|
+
<h3 style='color:#fff; margin:10px 0 10px 5px;'>#{og[:title]}</h3>
|
16
|
+
<img src='#{og[:image]}' style='float:left; max-width:184px; margin:5px 15px 0 5px'/>
|
17
|
+
<p>#{og[:description]}</p>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
HTML
|
21
|
+
end
|
22
|
+
|
23
|
+
def to_html
|
24
|
+
iframe_url = @url.gsub('/app/', '/widget/')
|
25
|
+
|
26
|
+
<<-HTML
|
27
|
+
<iframe src='#{iframe_url}'
|
28
|
+
frameborder='0'
|
29
|
+
width='100%'
|
30
|
+
height='190'>
|
31
|
+
</iframe>
|
32
|
+
HTML
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
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.6.
|
4
|
+
version: 1.6.1
|
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-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: multi_json
|
@@ -324,6 +324,7 @@ files:
|
|
324
324
|
- lib/onebox/engine/soundcloud_onebox.rb
|
325
325
|
- lib/onebox/engine/stack_exchange_onebox.rb
|
326
326
|
- lib/onebox/engine/standard_embed.rb
|
327
|
+
- lib/onebox/engine/steam_store_onebox.rb
|
327
328
|
- lib/onebox/engine/twitter_status_onebox.rb
|
328
329
|
- lib/onebox/engine/video_onebox.rb
|
329
330
|
- lib/onebox/engine/vimeo_onebox.rb
|