onebox 1.9.27.2 → 1.9.28
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f75f019a1f1010a08e3f1e054f571364f34258849587b38cc87f325df8cbb16
|
4
|
+
data.tar.gz: 3e51c2164d33a7e0e093745c2e36a841946fee472da1790f8bb1dc6ceca63649
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae466b4cad8aaf006383e2a6e8426e383170344272ce8a80ba2752a49461bf0acd71b02e976566cb6ed5f449e7903ea534e4895a8a991a1672319593aee53ba7
|
7
|
+
data.tar.gz: ed6f0545e705ca84509affc4a0f532cc95e24b9cb0ca83cc2e8a7160d4e253b32adf4d11e05f377796f23a0ac3ddb3201670cf7397effe2914b9381818775100
|
data/lib/onebox/engine.rb
CHANGED
@@ -176,5 +176,6 @@ require_relative "engine/instagram_onebox"
|
|
176
176
|
require_relative "engine/gitlab_blob_onebox"
|
177
177
|
require_relative "engine/google_photos_onebox"
|
178
178
|
require_relative "engine/kaltura_onebox"
|
179
|
-
require_relative "engine/
|
179
|
+
require_relative "engine/reddit_media_onebox"
|
180
180
|
require_relative "engine/google_drive_onebox"
|
181
|
+
require_relative "engine/facebook_media_onebox"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Onebox
|
4
|
+
module Engine
|
5
|
+
class FacebookMediaOnebox
|
6
|
+
include Engine
|
7
|
+
include StandardEmbed
|
8
|
+
|
9
|
+
matches_regexp(/^https?:\/\/.*\.facebook\.com\/(\w+)\/(videos|\?).*/)
|
10
|
+
always_https
|
11
|
+
|
12
|
+
def to_html
|
13
|
+
metadata = get_twitter
|
14
|
+
if metadata.present? && metadata[:card] == "player" && metadata[:player].present?
|
15
|
+
<<-HTML
|
16
|
+
<iframe src="#{metadata[:player]}"
|
17
|
+
width="#{metadata[:player_width]}"
|
18
|
+
height="#{metadata[:player_height]}"
|
19
|
+
scrolling="no"
|
20
|
+
frameborder="0"
|
21
|
+
allowfullscreen>
|
22
|
+
</iframe>
|
23
|
+
HTML
|
24
|
+
else
|
25
|
+
html = Onebox::Engine::WhitelistedGenericOnebox.new(@url, @timeout).to_html
|
26
|
+
return if Onebox::Helpers.blank?(html)
|
27
|
+
html
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Onebox
|
4
4
|
module Engine
|
5
|
-
class
|
5
|
+
class RedditMediaOnebox
|
6
6
|
include Engine
|
7
7
|
include StandardEmbed
|
8
8
|
|
@@ -25,6 +25,25 @@ module Onebox
|
|
25
25
|
</article>
|
26
26
|
</aside>
|
27
27
|
HTML
|
28
|
+
elsif raw[:type] =~ /^video[\/\.]/
|
29
|
+
<<-HTML
|
30
|
+
<aside class="onebox reddit">
|
31
|
+
<header class="source">
|
32
|
+
<img src="#{raw[:favicon]}" class="site-icon" width="16" height="16">
|
33
|
+
<a href="#{raw[:url]}" target="_blank" rel="nofollow ugc noopener">#{raw[:site_name]}</a>
|
34
|
+
</header>
|
35
|
+
<article class="onebox-body">
|
36
|
+
<h3><a href="#{raw[:url]}" target="_blank" rel="nofollow ugc noopener">#{raw[:title]}</a></h3>
|
37
|
+
<div class="aspect-image-full-size">
|
38
|
+
<a href="#{raw[:url]}" target="_blank" rel="nofollow ugc noopener">
|
39
|
+
<img src="#{raw[:image]}" class="scale-image"/>
|
40
|
+
<span class="reddit-video-icon"></span>
|
41
|
+
</a>
|
42
|
+
</div>
|
43
|
+
<div class="description"><p>#{raw[:description]}</p></div>
|
44
|
+
</article>
|
45
|
+
</aside>
|
46
|
+
HTML
|
28
47
|
else
|
29
48
|
html = Onebox::Engine::WhitelistedGenericOnebox.new(@url, @timeout).to_html
|
30
49
|
return if Onebox::Helpers.blank?(html)
|
@@ -57,6 +57,7 @@ module Onebox
|
|
57
57
|
ehow.com
|
58
58
|
espn.go.com
|
59
59
|
etsy.com
|
60
|
+
facebook.com
|
60
61
|
findery.com
|
61
62
|
folksy.com
|
62
63
|
forbes.com
|
@@ -77,6 +78,7 @@ module Onebox
|
|
77
78
|
kickstarter.com
|
78
79
|
kinomap.com
|
79
80
|
lessonplanet.com
|
81
|
+
linkedin.com
|
80
82
|
liveleak.com
|
81
83
|
livestream.com
|
82
84
|
mashable.com
|
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.9.
|
4
|
+
version: 1.9.28
|
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: 2020-
|
13
|
+
date: 2020-05-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: addressable
|
@@ -321,6 +321,7 @@ files:
|
|
321
321
|
- lib/onebox/engine/bandcamp_onebox.rb
|
322
322
|
- lib/onebox/engine/cloudapp_onebox.rb
|
323
323
|
- lib/onebox/engine/coub_onebox.rb
|
324
|
+
- lib/onebox/engine/facebook_media_onebox.rb
|
324
325
|
- lib/onebox/engine/five_hundred_px_onebox.rb
|
325
326
|
- lib/onebox/engine/flickr_onebox.rb
|
326
327
|
- lib/onebox/engine/flickr_shortened_onebox.rb
|
@@ -349,7 +350,7 @@ files:
|
|
349
350
|
- lib/onebox/engine/pastebin_onebox.rb
|
350
351
|
- lib/onebox/engine/pdf_onebox.rb
|
351
352
|
- lib/onebox/engine/pubmed_onebox.rb
|
352
|
-
- lib/onebox/engine/
|
353
|
+
- lib/onebox/engine/reddit_media_onebox.rb
|
353
354
|
- lib/onebox/engine/replit_onebox.rb
|
354
355
|
- lib/onebox/engine/simplecast_onebox.rb
|
355
356
|
- lib/onebox/engine/sketchfab_onebox.rb
|
@@ -433,7 +434,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
433
434
|
- !ruby/object:Gem::Version
|
434
435
|
version: '0'
|
435
436
|
requirements: []
|
436
|
-
rubygems_version: 3.
|
437
|
+
rubygems_version: 3.1.2
|
437
438
|
signing_key:
|
438
439
|
specification_version: 4
|
439
440
|
summary: A gem for generating embeddable HTML previews from URLs.
|