diff --git a/lib/oneboxer/amazon_onebox.rb b/lib/oneboxer/amazon_onebox.rb index 0a5c731e8..7814235a7 100644 --- a/lib/oneboxer/amazon_onebox.rb +++ b/lib/oneboxer/amazon_onebox.rb @@ -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") diff --git a/spec/components/oneboxer/amazon_onebox_spec.rb b/spec/components/oneboxer/amazon_onebox_spec.rb index 3c6906536..5a321f3fb 100644 --- a/spec/components/oneboxer/amazon_onebox_spec.rb +++ b/spec/components/oneboxer/amazon_onebox_spec.rb @@ -30,11 +30,9 @@ private
- -

The Ruby Programming Language (Paperback)

-

David Flanagan, Yukihiro Matsumoto

- -The Ruby Programming Language is the authoritative guide to Ruby ... + +

The Ruby Programming Language [Paperback]

+
diff --git a/spec/fixtures/oneboxer/amazon.response b/spec/fixtures/oneboxer/amazon.response index aeee9d2a1..e7a48288a 100644 --- a/spec/fixtures/oneboxer/amazon.response +++ b/spec/fixtures/oneboxer/amazon.response @@ -16,42 +16,80 @@ Transfer-Encoding: chunked - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + @@ -63,756 +101,13253 @@ ue_csm.ue_hob=ue_csm.ue_hob||+new Date();(function(b){var a=b.ue;a.rid=b.ue_id;a - - - The Ruby Programming Language:Amazon:Books - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - -
-
- -
-
-
-
-

The Ruby Programming Language (Paperback)

-David Flanagan, Yukihiro Matsumoto
- - -62 - -
-
-
-
- -
- - -
-
-
-
-
Larger image
-
-
-
- + + + + + + + + + + +
+ + + + + + + + + + + -
- - - - - - - - - - - - - -
List Price:$39.99
Price: -$23.99 - - -
You Save:$16.00 (40%)

-In Stock -

-

Ships from and sold by Amazon.com

-Gift-wrap available. -
-

FREE Super Saver Shipping on orders over $25.

-Want it delivered by Thursday, Feb 14? -Order within 14hr 42min, and choose One-Day Shipping at checkout. -

+window.amznJQ && amznJQ.available('navbarJS-beacon', function(){}); +window._navbarSpriteUrl = 'http://g-ecx.images-amazon.com/images/G/01/gno/beacon/BeaconSprite-US-01-plus._V357795017_.png'; +$Nav.importEvent('navbarJS-beacon'); +$Nav.importEvent('NavAuiJS'); +$Nav.declare('exposeSBD.enable',false); +$Nav.declare('img.spin','http://g-ecx.images-amazon.com/images/G/01/javascripts/lib/popover/images/snake._V192571611_.gif'); +$Nav.when('$').run(function($){ + var ie6 = $.browser.msie && parseInt($.browser.version) <= 6; + $Nav.declare('img.horz', ie6 ? + 'http://g-ecx.images-amazon.com/images/G/01/gno/beacon/nav-pop-8bit-h._V155961234_.png' : + 'http://g-ecx.images-amazon.com/images/G/01/gno/beacon/nav-pop-h-v2._V137157005_.png'); + $Nav.declare('img.vert', ie6 ? + 'http://g-ecx.images-amazon.com/images/G/01/gno/beacon/nav-pop-8bit-v._V155961234_.png' : + 'http://g-ecx.images-amazon.com/images/G/01/gno/beacon/nav-pop-v-v2._V137157005_.png'); +}); +--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+