onebox 1.5.18 → 1.5.19
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/lib/onebox/engine.rb +1 -0
- data/lib/onebox/engine/soundcloud_onebox.rb +24 -0
- data/lib/onebox/engine/twitter_status_onebox.rb +1 -1
- data/lib/onebox/engine/whitelisted_generic_onebox.rb +0 -1
- data/lib/onebox/version.rb +1 -1
- data/spec/lib/onebox/engine/twitter_status_onebox_spec.rb +3 -0
- 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: 1251f4223fba52393994afd37464bd4871ca7d50
|
4
|
+
data.tar.gz: 8d08a396a69afd7444ed606b680f62455b9ca772
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45b4ac31ab8c0d9d8f27e4b2a05ac356e03138631ddf3a357fa1a38ada58ff9178ea07b8893ac364beb2206331d6b5a8d53cba19f69531a7bb0e6284f6e0ff0e
|
7
|
+
data.tar.gz: 9161833850d7f2ef5434866c13900203f8d91efc3b62f93988e852184d1a265f4171bac87ba466a77fc324bcd3b26db056f18de5162dbf925314e2e81f518e9b
|
data/lib/onebox/engine.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
module Onebox
|
2
|
+
module Engine
|
3
|
+
class SoundCloudOnebox
|
4
|
+
include Engine
|
5
|
+
include StandardEmbed
|
6
|
+
|
7
|
+
matches_regexp(/^https?:\/\/.*soundcloud\.com/)
|
8
|
+
|
9
|
+
def to_html
|
10
|
+
get_oembed_data[:html].gsub!('height="400"', 'height="250"')
|
11
|
+
end
|
12
|
+
|
13
|
+
def placeholder_html
|
14
|
+
"<img src='#{get_oembed_data[:thumbnail_url]}'>"
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def get_oembed_data
|
20
|
+
Onebox::Helpers.symbolize_keys(::MultiJson.load(Onebox::Helpers.fetch_response("http://soundcloud.com/oembed.json?url=#{url}").body))
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/onebox/version.rb
CHANGED
@@ -94,6 +94,9 @@ describe Onebox::Engine::TwitterStatusOnebox do
|
|
94
94
|
allow(@twitter_client).to receive("prettify_tweet") do
|
95
95
|
"I'm a sucker for pledges. <a href='https://twitter.com/Peers' target='_blank'>@Peers</a> Pledge <a href='https://twitter.com/search?q=%23sharingeconomy' target='_blank'>#sharingeconomy</a> <a target='_blank' href='http://www.peers.org/action/peers-pledgea/'>peers.org/action/peers-p…</a>"
|
96
96
|
end
|
97
|
+
allow(@twitter_client).to receive("twitter_credentials_missing?") do
|
98
|
+
false
|
99
|
+
end
|
97
100
|
Onebox.options = { twitter_client: @twitter_client }
|
98
101
|
end
|
99
102
|
|
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.19
|
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-05-
|
13
|
+
date: 2015-05-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: multi_json
|
@@ -301,6 +301,7 @@ files:
|
|
301
301
|
- lib/onebox/engine/image_onebox.rb
|
302
302
|
- lib/onebox/engine/json.rb
|
303
303
|
- lib/onebox/engine/pubmed_onebox.rb
|
304
|
+
- lib/onebox/engine/soundcloud_onebox.rb
|
304
305
|
- lib/onebox/engine/stack_exchange_onebox.rb
|
305
306
|
- lib/onebox/engine/standard_embed.rb
|
306
307
|
- lib/onebox/engine/twitter_status_onebox.rb
|