Class: Onebox::Engine::AmazonOnebox

Inherits:
Object
  • Object
show all
Includes:
Onebox::Engine, HTML, LayoutSupport
Defined in:
lib/onebox/engine/amazon_onebox.rb

Instance Attribute Summary

Attributes included from Onebox::Engine

#cache, #timeout

Instance Method Summary collapse

Methods included from LayoutSupport

#layout, max_text, #to_html

Methods included from Onebox::Engine

engines, included, #initialize, #placeholder_html, #to_html

Instance Method Details

#http_paramsObject



16
17
18
# File 'lib/onebox/engine/amazon_onebox.rb', line 16

def http_params
  {'User-Agent' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3'}
end

#urlObject



11
12
13
14
# File 'lib/onebox/engine/amazon_onebox.rb', line 11

def url
  return "http://www.amazon.com/gp/aw/d/" + URI::encode(match[:id]) if match && match[:id]
  @url
end