mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-06-17 19:31:29 +08:00
17 lines
381 B
Ruby
Vendored
17 lines
381 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
module Onebox
|
|
class Oembed < OpenGraph
|
|
|
|
def initialize(response)
|
|
@data = Onebox::Helpers.symbolize_keys(::MultiJson.load(response))
|
|
|
|
# never use oembed from WordPress 4.4 (it's broken)
|
|
data.delete(:html) if data[:html] && data[:html]["wp-embedded-content"]
|
|
end
|
|
|
|
def html
|
|
get(:html, nil, false)
|
|
end
|
|
end
|
|
end
|