mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 16:18:42 -05:00
22 lines
492 B
Ruby
22 lines
492 B
Ruby
require_dependency 'oneboxer/oembed_onebox'
|
|
require_dependency 'freedom_patches/rails4'
|
|
|
|
module Oneboxer
|
|
class DiscourseRemoteOnebox < HandlebarsOnebox
|
|
|
|
matcher /^https?\:\/\/meta\.discourse\.org\/.*$/
|
|
favicon 'discourse.png'
|
|
|
|
def template
|
|
template_path('simple_onebox')
|
|
end
|
|
|
|
def parse(data)
|
|
doc = Nokogiri::HTML(data)
|
|
open_graph = Oneboxer.parse_open_graph(doc)
|
|
open_graph['text'] = open_graph['description']
|
|
open_graph
|
|
end
|
|
|
|
end
|
|
end
|