lib/onebox/engine/amazon_onebox.rb in onebox-1.2.9 vs lib/onebox/engine/amazon_onebox.rb in onebox-1.3.0
- old
+ new
@@ -3,15 +3,11 @@
class AmazonOnebox
include Engine
include LayoutSupport
include HTML
- matches do
- http
- maybe("www.")
- domain("amazon")
- has(".").either("com", "ca").maybe("/")
- end
+
+ matches_regexp(/^http:\/\/(?:www)\.amazon\.(com|ca)/)
def url
return "http://www.amazon.com/gp/aw/d/" + URI::encode(match[:id]) if match && match[:id]
@url
end