mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
FIX: Amazon spec
This commit is contained in:
@ -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")
|
||||
|
Reference in New Issue
Block a user