onebox 1.8.77 → 1.8.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/.rspec +0 -0
- data/.rubocop.yml +0 -0
- data/.ruby-gemset +0 -0
- data/.travis.yml +0 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +0 -0
- data/Gemfile.lock +3 -3
- data/Guardfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +2 -2
- data/Rakefile +0 -0
- data/lib/onebox.rb +0 -0
- data/lib/onebox/engine.rb +2 -0
- data/lib/onebox/engine/amazon_onebox.rb +0 -0
- data/lib/onebox/engine/asciinema_onebox.rb +0 -0
- data/lib/onebox/engine/audio_onebox.rb +0 -0
- data/lib/onebox/engine/audioboom_onebox.rb +0 -0
- data/lib/onebox/engine/bandcamp_onebox.rb +0 -0
- data/lib/onebox/engine/cloudapp_onebox.rb +0 -0
- data/lib/onebox/engine/coub_onebox.rb +0 -0
- data/lib/onebox/engine/douban_onebox.rb +0 -0
- data/lib/onebox/engine/five_hundred_px_onebox.rb +0 -0
- data/lib/onebox/engine/flickr_onebox.rb +0 -0
- data/lib/onebox/engine/flickr_shortened_onebox.rb +0 -0
- data/lib/onebox/engine/gfycat_onebox.rb +0 -0
- data/lib/onebox/engine/giphy_onebox.rb +0 -0
- data/lib/onebox/engine/github_blob_onebox.rb +0 -0
- data/lib/onebox/engine/github_commit_onebox.rb +0 -0
- data/lib/onebox/engine/github_gist_onebox.rb +0 -0
- data/lib/onebox/engine/github_issue_onebox.rb +0 -0
- data/lib/onebox/engine/github_pullrequest_onebox.rb +0 -0
- data/lib/onebox/engine/gitlab_blob_onebox.rb +0 -0
- data/lib/onebox/engine/google_calendar_onebox.rb +0 -0
- data/lib/onebox/engine/google_docs_onebox.rb +0 -0
- data/lib/onebox/engine/google_maps_onebox.rb +0 -0
- data/lib/onebox/engine/google_photos_onebox.rb +0 -0
- data/lib/onebox/engine/google_play_app_onebox.rb +0 -0
- data/lib/onebox/engine/html.rb +0 -0
- data/lib/onebox/engine/image_onebox.rb +0 -0
- data/lib/onebox/engine/imgur_onebox.rb +0 -0
- data/lib/onebox/engine/instagram_onebox.rb +0 -0
- data/lib/onebox/engine/json.rb +0 -0
- data/lib/onebox/engine/kaltura_onebox.rb +33 -0
- data/lib/onebox/engine/mixcloud_onebox.rb +0 -0
- data/lib/onebox/engine/opengraph_image.rb +0 -0
- data/lib/onebox/engine/pastebin_onebox.rb +0 -0
- data/lib/onebox/engine/pdf_onebox.rb +0 -0
- data/lib/onebox/engine/pubmed_onebox.rb +0 -0
- data/lib/onebox/engine/replit_onebox.rb +0 -0
- data/lib/onebox/engine/sketchfab_onebox.rb +1 -1
- data/lib/onebox/engine/slides_onebox.rb +0 -0
- data/lib/onebox/engine/soundcloud_onebox.rb +0 -0
- data/lib/onebox/engine/stack_exchange_onebox.rb +0 -0
- data/lib/onebox/engine/standard_embed.rb +0 -0
- data/lib/onebox/engine/steam_store_onebox.rb +0 -0
- data/lib/onebox/engine/trello_onebox.rb +0 -0
- data/lib/onebox/engine/twitch_clips_onebox.rb +0 -0
- data/lib/onebox/engine/twitch_stream_onebox.rb +0 -0
- data/lib/onebox/engine/twitch_video_onebox.rb +0 -0
- data/lib/onebox/engine/twitter_status_onebox.rb +0 -0
- data/lib/onebox/engine/typeform_onebox.rb +41 -0
- data/lib/onebox/engine/video_onebox.rb +0 -0
- data/lib/onebox/engine/vimeo_onebox.rb +0 -0
- data/lib/onebox/engine/wechat_mp_onebox.rb +0 -0
- data/lib/onebox/engine/whitelisted_generic_onebox.rb +0 -0
- data/lib/onebox/engine/wikimedia_onebox.rb +0 -0
- data/lib/onebox/engine/wikipedia_onebox.rb +0 -0
- data/lib/onebox/engine/wistia_onebox.rb +0 -0
- data/lib/onebox/engine/xkcd_onebox.rb +0 -0
- data/lib/onebox/engine/youku_onebox.rb +0 -0
- data/lib/onebox/engine/youtube_onebox.rb +0 -0
- data/lib/onebox/file_type_finder.rb +0 -0
- data/lib/onebox/helpers.rb +0 -0
- data/lib/onebox/layout.rb +0 -0
- data/lib/onebox/layout_support.rb +0 -0
- data/lib/onebox/matcher.rb +0 -0
- data/lib/onebox/mixins/git_blob_onebox.rb +0 -0
- data/lib/onebox/mixins/twitch_onebox.rb +0 -0
- data/lib/onebox/preview.rb +0 -0
- data/lib/onebox/sanitize_config.rb +0 -0
- data/lib/onebox/status_check.rb +0 -0
- data/lib/onebox/template_support.rb +0 -0
- data/lib/onebox/version.rb +1 -1
- data/lib/onebox/view.rb +0 -0
- data/lib/onebox/web.rb +0 -0
- data/lib/onebox/web_helpers.rb +0 -0
- data/onebox.gemspec +0 -0
- data/templates/_layout.mustache +0 -0
- data/templates/amazon.mustache +0 -0
- data/templates/douban.mustache +0 -0
- data/templates/githubblob.mustache +0 -0
- data/templates/githubcommit.mustache +0 -0
- data/templates/githubgist.mustache +0 -0
- data/templates/githubissue.mustache +0 -0
- data/templates/githubpullrequest.mustache +0 -0
- data/templates/gitlabblob.mustache +0 -0
- data/templates/googledocs.mustache +0 -0
- data/templates/googleplayapp.mustache +0 -0
- data/templates/instagram.mustache +0 -0
- data/templates/pastebin.mustache +0 -0
- data/templates/pdf.mustache +0 -0
- data/templates/pubmed.mustache +0 -0
- data/templates/stackexchange.mustache +0 -0
- data/templates/twitterstatus.mustache +0 -0
- data/templates/wechatmp.mustache +0 -0
- data/templates/whitelistedgeneric.mustache +0 -0
- data/templates/wikimedia.mustache +0 -0
- data/templates/wikipedia.mustache +0 -0
- data/templates/xkcd.mustache +0 -0
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2178e12356ed7b300df051ce85855ede74f44f307ea0cfae92a6991d84aa78b2
|
|
4
|
+
data.tar.gz: '059aac2d7b8498a8c135c09db94f15a4deb5236bd0544f1dc517c88c21d57ebc'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eaaf399a2338486a367bcf14d3350be8f8821840fa1d3e45c74c3a9b29b545fe433dedb0b077eb4b617dc9563fc5ef3abe07b424c32537d429b2aa9c42e7b36c
|
|
7
|
+
data.tar.gz: 7858b04e1dbbb59e5a23a03301b275e1a573505f9dbcbd7ec02201955991149120276a44bd42af50907987eeec1deab4bbbd99a2f1da9c66486dde4f487de168
|
data/.gitignore
CHANGED
|
File without changes
|
data/.rspec
CHANGED
|
File without changes
|
data/.rubocop.yml
CHANGED
|
File without changes
|
data/.ruby-gemset
CHANGED
|
File without changes
|
data/.travis.yml
CHANGED
|
File without changes
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
|
File without changes
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
onebox (1.8.
|
|
4
|
+
onebox (1.8.78)
|
|
5
5
|
htmlentities (~> 4.3)
|
|
6
6
|
moneta (~> 1.0)
|
|
7
7
|
multi_json (~> 1.11)
|
|
@@ -38,7 +38,7 @@ GEM
|
|
|
38
38
|
rspec (>= 2.14, < 4.0)
|
|
39
39
|
haml (4.0.7)
|
|
40
40
|
tilt
|
|
41
|
-
hitimes (1.3.
|
|
41
|
+
hitimes (1.3.1)
|
|
42
42
|
htmlentities (4.3.4)
|
|
43
43
|
jaro_winkler (1.5.2)
|
|
44
44
|
listen (2.10.1)
|
|
@@ -93,7 +93,7 @@ GEM
|
|
|
93
93
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
94
94
|
rspec-support (~> 3.8.0)
|
|
95
95
|
rspec-support (3.8.0)
|
|
96
|
-
rubocop (0.
|
|
96
|
+
rubocop (0.64.0)
|
|
97
97
|
jaro_winkler (~> 1.5.1)
|
|
98
98
|
parallel (~> 1.10)
|
|
99
99
|
parser (>= 2.5, != 2.5.1.1)
|
data/Guardfile
CHANGED
|
File without changes
|
data/LICENSE.txt
CHANGED
|
File without changes
|
data/README.md
CHANGED
|
@@ -132,7 +132,7 @@ Adding Support for a new URL
|
|
|
132
132
|
let(:html) { described_class.new(link).to_html }
|
|
133
133
|
|
|
134
134
|
before do
|
|
135
|
-
fake(link, response("name
|
|
135
|
+
fake(link, response("name"))
|
|
136
136
|
end
|
|
137
137
|
|
|
138
138
|
it "has the video's title" do
|
|
@@ -170,7 +170,7 @@ Adding Support for a new URL
|
|
|
170
170
|
5. Create new fixture from HTML response for your FakeWeb request(s)
|
|
171
171
|
|
|
172
172
|
``` bash
|
|
173
|
-
curl --output spec/fixtures/oneboxname.response -L -X
|
|
173
|
+
curl --output spec/fixtures/oneboxname.response -L -X GET http://example.com
|
|
174
174
|
```
|
|
175
175
|
|
|
176
176
|
6. Require in Engine module
|
data/Rakefile
CHANGED
|
File without changes
|
data/lib/onebox.rb
CHANGED
|
File without changes
|
data/lib/onebox/engine.rb
CHANGED
|
@@ -161,6 +161,7 @@ require_relative "engine/slides_onebox"
|
|
|
161
161
|
require_relative "engine/xkcd_onebox"
|
|
162
162
|
require_relative "engine/giphy_onebox"
|
|
163
163
|
require_relative "engine/gfycat_onebox"
|
|
164
|
+
require_relative "engine/typeform_onebox"
|
|
164
165
|
require_relative "engine/vimeo_onebox"
|
|
165
166
|
require_relative "engine/steam_store_onebox"
|
|
166
167
|
require_relative "engine/sketchfab_onebox"
|
|
@@ -184,3 +185,4 @@ require_relative "engine/wistia_onebox"
|
|
|
184
185
|
require_relative "engine/instagram_onebox"
|
|
185
186
|
require_relative "engine/gitlab_blob_onebox"
|
|
186
187
|
require_relative "engine/google_photos_onebox"
|
|
188
|
+
require_relative "engine/kaltura_onebox"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/onebox/engine/html.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/onebox/engine/json.rb
CHANGED
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module Onebox
|
|
2
|
+
module Engine
|
|
3
|
+
class KalturaOnebox
|
|
4
|
+
include Engine
|
|
5
|
+
include StandardEmbed
|
|
6
|
+
|
|
7
|
+
always_https
|
|
8
|
+
matches_regexp(/^https?:\/\/[a-z0-9]+\.kaltura\.com\/id\/[a-zA-Z0-9]+/)
|
|
9
|
+
|
|
10
|
+
def preview_html
|
|
11
|
+
og = get_opengraph
|
|
12
|
+
thumbnail_url = ::Onebox::Helpers.normalize_url_for_output(og[:image_secure_url])
|
|
13
|
+
|
|
14
|
+
<<~HTML
|
|
15
|
+
<img src="#{thumbnail_url}" width="#{og[:video_width]}" height="#{og[:video_height]}" >
|
|
16
|
+
HTML
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def to_html
|
|
20
|
+
og = get_opengraph
|
|
21
|
+
embedded_video_url = ::Onebox::Helpers.normalize_url_for_output(og[:video_secure_url])
|
|
22
|
+
|
|
23
|
+
<<~HTML
|
|
24
|
+
<iframe src="#{embedded_video_url}"
|
|
25
|
+
width="#{og[:video_width]}" height="#{og[:video_height]}"
|
|
26
|
+
frameborder='0'
|
|
27
|
+
allowfullscreen >
|
|
28
|
+
</iframe>
|
|
29
|
+
HTML
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
module Onebox
|
|
2
|
+
module Engine
|
|
3
|
+
class TypeformOnebox
|
|
4
|
+
include Engine
|
|
5
|
+
|
|
6
|
+
matches_regexp(/^https?:\/\/[a-z0-9]+\.typeform\.com\/to\/[a-zA-Z0-9]+/)
|
|
7
|
+
always_https
|
|
8
|
+
|
|
9
|
+
def to_html
|
|
10
|
+
typeform_src = build_typeform_src
|
|
11
|
+
|
|
12
|
+
<<~HTML
|
|
13
|
+
<iframe src="#{typeform_src}"
|
|
14
|
+
width="100%"
|
|
15
|
+
height="600px"
|
|
16
|
+
scrolling="no"
|
|
17
|
+
frameborder="0">
|
|
18
|
+
</iframe>
|
|
19
|
+
HTML
|
|
20
|
+
end
|
|
21
|
+
alias placeholder_html to_html
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
def build_typeform_src
|
|
26
|
+
escaped_src = ::Onebox::Helpers.normalize_url_for_output(@url)
|
|
27
|
+
query_params = CGI::parse(URI::parse(escaped_src).query || '')
|
|
28
|
+
|
|
29
|
+
return escaped_src if query_params.has_key?('typeform-embed')
|
|
30
|
+
|
|
31
|
+
if query_params.empty?
|
|
32
|
+
escaped_src << '?' unless escaped_src.end_with?('?')
|
|
33
|
+
else
|
|
34
|
+
escaped_src << '&'
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
escaped_src << 'typeform-embed=embed-widget'
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/onebox/helpers.rb
CHANGED
|
File without changes
|
data/lib/onebox/layout.rb
CHANGED
|
File without changes
|
|
File without changes
|
data/lib/onebox/matcher.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/onebox/preview.rb
CHANGED
|
File without changes
|
|
File without changes
|
data/lib/onebox/status_check.rb
CHANGED
|
File without changes
|
|
File without changes
|
data/lib/onebox/version.rb
CHANGED
data/lib/onebox/view.rb
CHANGED
|
File without changes
|
data/lib/onebox/web.rb
CHANGED
|
File without changes
|
data/lib/onebox/web_helpers.rb
CHANGED
|
File without changes
|
data/onebox.gemspec
CHANGED
|
File without changes
|
data/templates/_layout.mustache
CHANGED
|
File without changes
|
data/templates/amazon.mustache
CHANGED
|
File without changes
|
data/templates/douban.mustache
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/templates/pastebin.mustache
CHANGED
|
File without changes
|
data/templates/pdf.mustache
CHANGED
|
File without changes
|
data/templates/pubmed.mustache
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/templates/wechatmp.mustache
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/templates/xkcd.mustache
CHANGED
|
File without changes
|
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.8.
|
|
4
|
+
version: 1.8.78
|
|
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: 2019-02-
|
|
13
|
+
date: 2019-02-19 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: multi_json
|
|
@@ -330,6 +330,7 @@ files:
|
|
|
330
330
|
- lib/onebox/engine/imgur_onebox.rb
|
|
331
331
|
- lib/onebox/engine/instagram_onebox.rb
|
|
332
332
|
- lib/onebox/engine/json.rb
|
|
333
|
+
- lib/onebox/engine/kaltura_onebox.rb
|
|
333
334
|
- lib/onebox/engine/mixcloud_onebox.rb
|
|
334
335
|
- lib/onebox/engine/opengraph_image.rb
|
|
335
336
|
- lib/onebox/engine/pastebin_onebox.rb
|
|
@@ -347,6 +348,7 @@ files:
|
|
|
347
348
|
- lib/onebox/engine/twitch_stream_onebox.rb
|
|
348
349
|
- lib/onebox/engine/twitch_video_onebox.rb
|
|
349
350
|
- lib/onebox/engine/twitter_status_onebox.rb
|
|
351
|
+
- lib/onebox/engine/typeform_onebox.rb
|
|
350
352
|
- lib/onebox/engine/video_onebox.rb
|
|
351
353
|
- lib/onebox/engine/vimeo_onebox.rb
|
|
352
354
|
- lib/onebox/engine/wechat_mp_onebox.rb
|
|
@@ -415,7 +417,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
415
417
|
version: '0'
|
|
416
418
|
requirements: []
|
|
417
419
|
rubyforge_project:
|
|
418
|
-
rubygems_version: 2.7.
|
|
420
|
+
rubygems_version: 2.7.6
|
|
419
421
|
signing_key:
|
|
420
422
|
specification_version: 4
|
|
421
423
|
summary: A gem for generating embeddable HTML previews from URLs.
|