FIX: Amazon spec

This commit is contained in:
Robin Ward
2013-10-04 12:49:39 -04:00
parent 2a97dbbb1f
commit c8487f6bc7
4 changed files with 13271 additions and 739 deletions

View File

@ -12,7 +12,6 @@ module Oneboxer
# Use the mobile version of the site
def translate_url
# If we're already mobile don't translate the url
return @url if @url =~ /https?:\/\/www\.amazon\.com\/gp\/aw\/d\//
@ -26,9 +25,9 @@ module Oneboxer
result = {}
result[:title] = html_doc.at("h1")
result[:title] = result[:title].inner_html if result[:title].present?
result[:title] = result[:title].inner_text.strip if result[:title].present?
image = html_doc.at(".a-image-wrapper img")
image = html_doc.at("#main-image")
result[:image] = image['src'] if image
result[:by_info] = html_doc.at("#by-line")