# frozen_string_literal: true require_relative './opengraph_image' module Onebox module Engine class FlickrOnebox include Engine include StandardEmbed 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