From ee23a088eaa3c338b8ebe701a191a9a939e95b7a Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 17 Apr 2013 16:24:00 -0400 Subject: [PATCH] Add SoundcloudOnebox to support http and https --- lib/oneboxer/soundcloud_onebox.rb | 10 ++++++++++ lib/oneboxer/whitelist.rb | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 lib/oneboxer/soundcloud_onebox.rb diff --git a/lib/oneboxer/soundcloud_onebox.rb b/lib/oneboxer/soundcloud_onebox.rb new file mode 100644 index 000000000..ec42929dc --- /dev/null +++ b/lib/oneboxer/soundcloud_onebox.rb @@ -0,0 +1,10 @@ +require_dependency 'oneboxer/oembed_onebox' + +module Oneboxer + class SoundcloudOnebox < OembedOnebox + matcher /^https?:\/\/(?:www\.)?soundcloud\.com\/.+$/ + def oembed_endpoint + "http://soundcloud.com/oembed?url=#{BaseOnebox.uriencode(@url.sub('https://', 'http://'))}&format=json" + end + end +end diff --git a/lib/oneboxer/whitelist.rb b/lib/oneboxer/whitelist.rb index 61b87544b..7d3300c4f 100644 --- a/lib/oneboxer/whitelist.rb +++ b/lib/oneboxer/whitelist.rb @@ -45,7 +45,6 @@ module Oneboxer Entry.new(/^https?:\/\/(?:www\.)?samsung\.com\/.+/), Entry.new(/^https?:\/\/(?:www\.)?mashable\.com\/.+/), Entry.new(/^https?:\/\/(?:www\.)?forbes\.com\/.+/), - Entry.new(/^https?:\/\/(?:www\.)?soundcloud\.com\/.+/), Entry.new(/^https?:\/\/(?:www\.)?thefreedictionary\.com\/.+/), Entry.new(/^https?:\/\/(?:www\.)?groupon\.com\/.+/), Entry.new(/^https?:\/\/(?:www\.)?ikea\.com\/.+/),