Sha256: 0f539f9f3cbc9b356694270c330f194a3be0a844198bcb23f24a20b4462624e8
Contents?: true
Size: 888 Bytes
Versions: 21
Compression:
Stored size: 888 Bytes
Contents
module Onebox module Engine class SoundCloudOnebox include Engine include StandardEmbed matches_regexp(/^https?:\/\/.*soundcloud\.com/) always_https def to_html oembed_data = get_oembed_data[:html] oembed_data.gsub!('visual=true', 'visual=false') || oembed_data end def placeholder_html "<img src='#{get_oembed_data[:thumbnail_url]}'>" end private def set? url =~ /\/sets\// end def get_oembed_data if set? Onebox::Helpers.symbolize_keys(::MultiJson.load(Onebox::Helpers.fetch_response("https://soundcloud.com/oembed.json?url=#{url}").body)) else Onebox::Helpers.symbolize_keys(::MultiJson.load(Onebox::Helpers.fetch_response("https://soundcloud.com/oembed.json?url=#{url}&maxheight=166").body)) end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems