diff --git a/lib/onebox/engine/flickr_onebox.rb b/lib/onebox/engine/flickr_onebox.rb index ea69d037..94c05a58 100644 --- a/lib/onebox/engine/flickr_onebox.rb +++ b/lib/onebox/engine/flickr_onebox.rb @@ -7,10 +7,47 @@ module Engine class FlickrOnebox include Engine include StandardEmbed - include OpengraphImage matches_regexp(/^https?:\/\/www\.flickr\.com\/photos\//) always_https + + def to_html + og = get_opengraph + return album_html(og) if og.url =~ /\/sets\// + return image_html(og) if !og.image.nil? + nil + end + + private + + def album_html(og) + escaped_url = ::Onebox::Helpers.normalize_url_for_output(url) + album_title = "[Album] #{og.title}" + + <<-HTML +
+ + + + #{album_title} + + + + +
+ HTML + end + + def image_html(og) + escaped_url = ::Onebox::Helpers.normalize_url_for_output(url) + + <<-HTML + + Imgur + + HTML + end + end end end