Class: Onebox::Engine::AmazonOnebox
Constant Summary
DEFAULT
Instance Attribute Summary
#timeout, #uri
Instance Method Summary
collapse
#layout, max_text, #to_html
engines, included, #initialize, #options, #options=, #placeholder_html, #to_html
Instance Method Details
#http_params ⇒ Object
28
29
30
31
32
33
|
# File 'lib/onebox/engine/amazon_onebox.rb', line 28
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
|
#tld ⇒ Object
24
25
26
|
# File 'lib/onebox/engine/amazon_onebox.rb', line 24
def tld
@tld || @@matcher.match(@url)["tld"]
end
|
#url ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/onebox/engine/amazon_onebox.rb', line 16
def url
if match && match[:id]
return "https://www.amazon.#{tld}/gp/aw/d/#{Onebox::Helpers.uri_encode(match[:id])}"
end
@url
end
|