Sha256: abee5408f78e7ee3f27178cbaac6ec120b9f134e206413437acf03adc342d407

Contents?: true

Size: 978 Bytes

Versions: 13

Compression:

Stored size: 978 Bytes

Contents

module Onebox
  module Engine
    class SteamStoreOnebox
      include Engine
      include StandardEmbed

      always_https
      matches_regexp(/^https?:\/\/store\.steampowered\.com\/app\/\d+/)

      def placeholder_html
        og = get_opengraph
        <<-HTML
          <div style='width:100%; height:190px; background-color:#262626; color:#9e9e9e; margin:15px 0;'>
            <div style='padding:10px'>
              <h3 style='color:#fff; margin:10px 0 10px 5px;'>#{og[:title]}</h3>
              <img src='#{og[:image]}' style='float:left; max-width:184px; margin:5px 15px 0 5px'/>
              <p>#{og[:description]}</p>
            </div>
          </div>
        HTML
      end

      def to_html
        iframe_url = @url.gsub('/app/', '/widget/')

        <<-HTML
          <iframe src='#{iframe_url}'
                  frameborder='0'
                  width='100%'
                  height='190'>
          </iframe>
        HTML
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
onebox-1.7.3 lib/onebox/engine/steam_store_onebox.rb
onebox-1.7.2 lib/onebox/engine/steam_store_onebox.rb
onebox-1.7.1 lib/onebox/engine/steam_store_onebox.rb
onebox-1.7.0 lib/onebox/engine/steam_store_onebox.rb
onebox-1.6.9 lib/onebox/engine/steam_store_onebox.rb
onebox-1.6.8 lib/onebox/engine/steam_store_onebox.rb
onebox-1.6.7 lib/onebox/engine/steam_store_onebox.rb
onebox-1.6.6 lib/onebox/engine/steam_store_onebox.rb
onebox-1.6.5 lib/onebox/engine/steam_store_onebox.rb
onebox-1.6.4 lib/onebox/engine/steam_store_onebox.rb
onebox-1.6.3 lib/onebox/engine/steam_store_onebox.rb
onebox-1.6.2 lib/onebox/engine/steam_store_onebox.rb
onebox-1.6.1 lib/onebox/engine/steam_store_onebox.rb