asin 0.8.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/.document +1 -2
  2. data/{CHANGELOG.rdoc → CHANGELOG.md} +12 -12
  3. data/Gemfile.lock +6 -0
  4. data/README.md +153 -0
  5. data/lib/asin/client.rb +6 -5
  6. data/lib/asin/configuration.rb +9 -20
  7. data/lib/asin/version.rb +1 -1
  8. data/spec/browse_node_spec.rb +2 -1
  9. data/spec/cart_spec.rb +2 -1
  10. data/spec/cassettes/asin/asin_cart_with_an_existing_cart_should_add_items_to_a_cart.yml +62 -46
  11. data/spec/cassettes/asin/asin_cart_with_an_existing_cart_should_clear_a_cart.yml +60 -45
  12. data/spec/cassettes/asin/asin_cart_with_an_existing_cart_should_get_a_cart.yml +61 -46
  13. data/spec/cassettes/asin/asin_cart_with_an_existing_cart_should_update_a_cart.yml +64 -49
  14. data/spec/cassettes/asin/browse_node_should_lookup_a_browse_node.yml +28 -22
  15. data/spec/cassettes/asin/cart_should_create_a_cart.yml +30 -23
  16. data/spec/cassettes/asin/lookup_and_search_should_have_metadata.yml +70 -61
  17. data/spec/cassettes/asin/lookup_and_search_should_lookup_a_book.yml +70 -61
  18. data/spec/cassettes/asin/lookup_and_search_should_lookup_multiple_books.yml +120 -111
  19. data/spec/cassettes/asin/lookup_and_search_should_lookup_multiple_response_groups.yml +37 -32
  20. data/spec/cassettes/asin/lookup_and_search_should_return_a_custom_item_class.yml +70 -61
  21. data/spec/cassettes/asin/lookup_and_search_should_return_a_mash_value.yml +70 -61
  22. data/spec/cassettes/asin/lookup_and_search_should_return_a_rash_value.yml +70 -61
  23. data/spec/cassettes/asin/lookup_and_search_should_return_a_raw_value.yml +70 -61
  24. data/spec/cassettes/asin/lookup_and_search_should_search_keywords_a_book_with_fulltext.yml +573 -524
  25. data/spec/cassettes/asin/lookup_and_search_should_search_keywords_and_handle_a_single_result.yml +45 -37
  26. data/spec/cassettes/asin/lookup_and_search_should_search_keywords_never_mind_music.yml +109 -104
  27. data/spec/cassettes/asin/lookup_and_search_should_search_music.yml +28 -26
  28. data/spec/cassettes/asin/lookup_and_search_should_search_never_mind_music.yml +112 -110
  29. data/spec/cassettes/asin/similarity_should_find_similar_items.yml +500 -488
  30. data/spec/cassettes/asin/similarity_should_find_similar_items_for_multiple_asins_and_different_config.yml +53 -26
  31. data/spec/config_spec.rb +1 -1
  32. data/spec/search_spec.rb +7 -9
  33. data/spec/similarity_spec.rb +5 -4
  34. data/spec/spec_helper.rb +3 -1
  35. metadata +89 -31
  36. data/README.rdoc +0 -169
  37. data/spec/cassettes/asin/similarity_should_lookup_for_similar_items.yml +0 -618
@@ -2,7 +2,7 @@
2
2
  - !ruby/struct:VCR::HTTPInteraction
3
3
  request: !ruby/struct:VCR::Request
4
4
  method: :get
5
- uri: http://webservices.amazon.com:80/onca/xml?AWSAccessKeyId=AKIAJFA5X7RTOKFNPVZQ&ItemId=1430218150,1430216263&Operation=SimilarityLookup&ResponseGroup=Small&Service=AWSECommerceService&Signature=Fcwu+ECO5oM2r2I8ij7wsh0Pi0BLF63kc5RRWJzkrDE=&SimilarityType=Intersection&Timestamp=2012-08-02T20:43:19Z&Version=2010-11-01
5
+ uri: http://webservices.amazon.com:80/onca/xml?AWSAccessKeyId=AKIAIBNLWSCV5OXMPD6A&AssociateTag=phoet-20&ItemId=1430218150,1430216263&Operation=SimilarityLookup&ResponseGroup=Small&Service=AWSECommerceService&Signature=eyrXTLjIPe3tndamahgTG2HWVjeg3vblhDsvf7Heqlo=&SimilarityType=Intersection&Timestamp=2012-09-22T13:41:53Z&Version=2011-08-01
6
6
  body:
7
7
  headers:
8
8
  response: !ruby/struct:VCR::Response
@@ -13,7 +13,7 @@
13
13
  headers:
14
14
  !binary "ZGF0ZQ==":
15
15
  - !binary |-
16
- VGh1LCAwMiBBdWcgMjAxMiAyMDo0MzoxNSBHTVQ=
16
+ U2F0LCAyMiBTZXAgMjAxMiAxMzo0MTo0OSBHTVQ=
17
17
  !binary "c2VydmVy":
18
18
  - !binary |-
19
19
  U2VydmVy
@@ -29,30 +29,57 @@
29
29
  !binary "dHJhbnNmZXItZW5jb2Rpbmc=":
30
30
  - !binary |-
31
31
  Y2h1bmtlZA==
32
- body: ! '<?xml version="1.0" encoding="UTF-8"?><SimilarityLookupResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2010-11-01"><OperationRequest><HTTPHeaders><Header
33
- Name="UserAgent" Value="Jakarta Commons-HttpClient/3.0.1"></Header></HTTPHeaders><RequestId>1ZPH5E08C1BYC3PRFQC3</RequestId><Arguments><Argument
34
- Name="ItemId" Value="1430218150,1430216263"></Argument><Argument Name="Service"
35
- Value="AWSECommerceService"></Argument><Argument Name="Signature" Value="Fcwu+ECO5oM2r2I8ij7wsh0Pi0BLF63kc5RRWJzkrDE="></Argument><Argument
36
- Name="ResponseGroup" Value="Small"></Argument><Argument Name="SimilarityType"
37
- Value="Intersection"></Argument><Argument Name="Operation" Value="SimilarityLookup"></Argument><Argument
38
- Name="AWSAccessKeyId" Value="AKIAJFA5X7RTOKFNPVZQ"></Argument><Argument Name="Timestamp"
39
- Value="2012-08-02T20:43:19Z"></Argument><Argument Name="Version" Value="2010-11-01"></Argument></Arguments><RequestProcessingTime>0.0326471328735352</RequestProcessingTime></OperationRequest><Items><Request><IsValid>True</IsValid><SimilarityLookupRequest><ItemId>1430216263</ItemId><ItemId>1430218150</ItemId><ResponseGroup>Small</ResponseGroup><SimilarityType>Intersection</SimilarityType></SimilarityLookupRequest></Request><Item><ASIN>143023024X</ASIN><DetailPageURL>http://www.amazon.com/Beginning-iPhone-Development-Exploring-iOS/dp/143023024X%3FSubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D143023024X</DetailPageURL><ItemLinks><ItemLink><Description>Technical
40
- Details</Description><URL>http://www.amazon.com/Beginning-iPhone-Development-Exploring-iOS/dp/tech-data/143023024X%3FSubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D143023024X</URL></ItemLink><ItemLink><Description>Add
41
- To Baby Registry</Description><URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3D143023024X%26SubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D143023024X</URL></ItemLink><ItemLink><Description>Add
42
- To Wedding Registry</Description><URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3D143023024X%26SubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D143023024X</URL></ItemLink><ItemLink><Description>Add
43
- To Wishlist</Description><URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3D143023024X%26SubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D143023024X</URL></ItemLink><ItemLink><Description>Tell
44
- A Friend</Description><URL>http://www.amazon.com/gp/pdp/taf/143023024X%3FSubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D143023024X</URL></ItemLink><ItemLink><Description>All
45
- Customer Reviews</Description><URL>http://www.amazon.com/review/product/143023024X%3FSubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D143023024X</URL></ItemLink><ItemLink><Description>All
46
- Offers</Description><URL>http://www.amazon.com/gp/offer-listing/143023024X%3FSubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D143023024X</URL></ItemLink></ItemLinks><ItemAttributes><Author>David
32
+ body: ! '<?xml version="1.0" ?><SimilarityLookupResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2011-08-01"><OperationRequest><RequestId>3dad69f9-6456-4e26-b02b-6044c4a30488</RequestId><Arguments><Argument
33
+ Name="SimilarityType" Value="Intersection"></Argument><Argument Name="Operation"
34
+ Value="SimilarityLookup"></Argument><Argument Name="Service" Value="AWSECommerceService"></Argument><Argument
35
+ Name="Signature" Value="eyrXTLjIPe3tndamahgTG2HWVjeg3vblhDsvf7Heqlo="></Argument><Argument
36
+ Name="AssociateTag" Value="phoet-20"></Argument><Argument Name="Version" Value="2011-08-01"></Argument><Argument
37
+ Name="ItemId" Value="1430218150,1430216263"></Argument><Argument Name="AWSAccessKeyId"
38
+ Value="AKIAIBNLWSCV5OXMPD6A"></Argument><Argument Name="Timestamp" Value="2012-09-22T13:41:53Z"></Argument><Argument
39
+ Name="ResponseGroup" Value="Small"></Argument></Arguments><RequestProcessingTime>0.0794200000000000</RequestProcessingTime></OperationRequest><Items><Request><IsValid>True</IsValid><SimilarityLookupRequest><ItemId>1430218150</ItemId><ItemId>1430216263</ItemId><ResponseGroup>Small</ResponseGroup><SimilarityType>Intersection</SimilarityType></SimilarityLookupRequest></Request><Item><ASIN>1430236051</ASIN><DetailPageURL>http://www.amazon.com/Beginning-iOS-Development-Exploring-SDK/dp/1430236051%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1430236051</DetailPageURL><ItemLinks><ItemLink><Description>Technical
40
+ Details</Description><URL>http://www.amazon.com/Beginning-iOS-Development-Exploring-SDK/dp/tech-data/1430236051%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1430236051</URL></ItemLink><ItemLink><Description>Add
41
+ To Baby Registry</Description><URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3D1430236051%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1430236051</URL></ItemLink><ItemLink><Description>Add
42
+ To Wedding Registry</Description><URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3D1430236051%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1430236051</URL></ItemLink><ItemLink><Description>Add
43
+ To Wishlist</Description><URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3D1430236051%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1430236051</URL></ItemLink><ItemLink><Description>Tell
44
+ A Friend</Description><URL>http://www.amazon.com/gp/pdp/taf/1430236051%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1430236051</URL></ItemLink><ItemLink><Description>All
45
+ Customer Reviews</Description><URL>http://www.amazon.com/review/product/1430236051%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1430236051</URL></ItemLink><ItemLink><Description>All
46
+ Offers</Description><URL>http://www.amazon.com/gp/offer-listing/1430236051%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1430236051</URL></ItemLink></ItemLinks><ItemAttributes><Author>David
47
47
  Mark</Author><Author>Jack Nutting</Author><Author>Jeff LaMarche</Author><Manufacturer>Apress</Manufacturer><ProductGroup>Book</ProductGroup><Title>Beginning
48
- iPhone 4 Development: Exploring the iOS SDK</Title></ItemAttributes></Item><Item><ASIN>0321566157</ASIN><DetailPageURL>http://www.amazon.com/Programming-Objective-C-2-0-Stephen-Kochan/dp/0321566157%3FSubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0321566157</DetailPageURL><ItemLinks><ItemLink><Description>Technical
49
- Details</Description><URL>http://www.amazon.com/Programming-Objective-C-2-0-Stephen-Kochan/dp/tech-data/0321566157%3FSubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321566157</URL></ItemLink><ItemLink><Description>Add
50
- To Baby Registry</Description><URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3D0321566157%26SubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321566157</URL></ItemLink><ItemLink><Description>Add
51
- To Wedding Registry</Description><URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3D0321566157%26SubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321566157</URL></ItemLink><ItemLink><Description>Add
52
- To Wishlist</Description><URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3D0321566157%26SubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321566157</URL></ItemLink><ItemLink><Description>Tell
53
- A Friend</Description><URL>http://www.amazon.com/gp/pdp/taf/0321566157%3FSubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321566157</URL></ItemLink><ItemLink><Description>All
54
- Customer Reviews</Description><URL>http://www.amazon.com/review/product/0321566157%3FSubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321566157</URL></ItemLink><ItemLink><Description>All
55
- Offers</Description><URL>http://www.amazon.com/gp/offer-listing/0321566157%3FSubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321566157</URL></ItemLink></ItemLinks><ItemAttributes><Author>Stephen
48
+ iOS 5 Development: Exploring the iOS SDK</Title></ItemAttributes></Item><Item><ASIN>0321811909</ASIN><DetailPageURL>http://www.amazon.com/Programming-Objective-C-Edition-Developers-Library/dp/0321811909%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0321811909</DetailPageURL><ItemLinks><ItemLink><Description>Technical
49
+ Details</Description><URL>http://www.amazon.com/Programming-Objective-C-Edition-Developers-Library/dp/tech-data/0321811909%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321811909</URL></ItemLink><ItemLink><Description>Add
50
+ To Baby Registry</Description><URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3D0321811909%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321811909</URL></ItemLink><ItemLink><Description>Add
51
+ To Wedding Registry</Description><URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3D0321811909%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321811909</URL></ItemLink><ItemLink><Description>Add
52
+ To Wishlist</Description><URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3D0321811909%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321811909</URL></ItemLink><ItemLink><Description>Tell
53
+ A Friend</Description><URL>http://www.amazon.com/gp/pdp/taf/0321811909%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321811909</URL></ItemLink><ItemLink><Description>All
54
+ Customer Reviews</Description><URL>http://www.amazon.com/review/product/0321811909%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321811909</URL></ItemLink><ItemLink><Description>All
55
+ Offers</Description><URL>http://www.amazon.com/gp/offer-listing/0321811909%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321811909</URL></ItemLink></ItemLinks><ItemAttributes><Author>Stephen
56
56
  G. Kochan</Author><Manufacturer>Addison-Wesley Professional</Manufacturer><ProductGroup>Book</ProductGroup><Title>Programming
57
- in Objective-C 2.0 (2nd Edition)</Title></ItemAttributes></Item></Items></SimilarityLookupResponse>'
57
+ in Objective-C (4th Edition) (Developer''s Library)</Title></ItemAttributes></Item><Item><ASIN>143023024X</ASIN><DetailPageURL>http://www.amazon.com/Beginning-iPhone-Development-Exploring-iOS/dp/143023024X%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D143023024X</DetailPageURL><ItemLinks><ItemLink><Description>Technical
58
+ Details</Description><URL>http://www.amazon.com/Beginning-iPhone-Development-Exploring-iOS/dp/tech-data/143023024X%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D143023024X</URL></ItemLink><ItemLink><Description>Add
59
+ To Baby Registry</Description><URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3D143023024X%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D143023024X</URL></ItemLink><ItemLink><Description>Add
60
+ To Wedding Registry</Description><URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3D143023024X%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D143023024X</URL></ItemLink><ItemLink><Description>Add
61
+ To Wishlist</Description><URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3D143023024X%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D143023024X</URL></ItemLink><ItemLink><Description>Tell
62
+ A Friend</Description><URL>http://www.amazon.com/gp/pdp/taf/143023024X%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D143023024X</URL></ItemLink><ItemLink><Description>All
63
+ Customer Reviews</Description><URL>http://www.amazon.com/review/product/143023024X%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D143023024X</URL></ItemLink><ItemLink><Description>All
64
+ Offers</Description><URL>http://www.amazon.com/gp/offer-listing/143023024X%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D143023024X</URL></ItemLink></ItemLinks><ItemAttributes><Author>David
65
+ Mark</Author><Author>Jack Nutting</Author><Author>Jeff LaMarche</Author><Manufacturer>Apress</Manufacturer><ProductGroup>Book</ProductGroup><Title>Beginning
66
+ iPhone 4 Development: Exploring the iOS SDK</Title></ItemAttributes></Item><Item><ASIN>0321711394</ASIN><DetailPageURL>http://www.amazon.com/Programming-Objective-C-Edition-Developers-Library/dp/0321711394%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0321711394</DetailPageURL><ItemLinks><ItemLink><Description>Technical
67
+ Details</Description><URL>http://www.amazon.com/Programming-Objective-C-Edition-Developers-Library/dp/tech-data/0321711394%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321711394</URL></ItemLink><ItemLink><Description>Add
68
+ To Baby Registry</Description><URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3D0321711394%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321711394</URL></ItemLink><ItemLink><Description>Add
69
+ To Wedding Registry</Description><URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3D0321711394%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321711394</URL></ItemLink><ItemLink><Description>Add
70
+ To Wishlist</Description><URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3D0321711394%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321711394</URL></ItemLink><ItemLink><Description>Tell
71
+ A Friend</Description><URL>http://www.amazon.com/gp/pdp/taf/0321711394%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321711394</URL></ItemLink><ItemLink><Description>All
72
+ Customer Reviews</Description><URL>http://www.amazon.com/review/product/0321711394%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321711394</URL></ItemLink><ItemLink><Description>All
73
+ Offers</Description><URL>http://www.amazon.com/gp/offer-listing/0321711394%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0321711394</URL></ItemLink></ItemLinks><ItemAttributes><Author>Stephen
74
+ G. Kochan</Author><Manufacturer>Addison-Wesley Professional</Manufacturer><ProductGroup>Book</ProductGroup><Title>Programming
75
+ in Objective-C, Third Edition (Developer''s Library)</Title></ItemAttributes></Item><Item><ASIN>1430218592</ASIN><DetailPageURL>http://www.amazon.com/Learn-Cocoa-Mac-Series/dp/1430218592%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1430218592</DetailPageURL><ItemLinks><ItemLink><Description>Technical
76
+ Details</Description><URL>http://www.amazon.com/Learn-Cocoa-Mac-Series/dp/tech-data/1430218592%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1430218592</URL></ItemLink><ItemLink><Description>Add
77
+ To Baby Registry</Description><URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3D1430218592%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1430218592</URL></ItemLink><ItemLink><Description>Add
78
+ To Wedding Registry</Description><URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3D1430218592%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1430218592</URL></ItemLink><ItemLink><Description>Add
79
+ To Wishlist</Description><URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3D1430218592%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1430218592</URL></ItemLink><ItemLink><Description>Tell
80
+ A Friend</Description><URL>http://www.amazon.com/gp/pdp/taf/1430218592%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1430218592</URL></ItemLink><ItemLink><Description>All
81
+ Customer Reviews</Description><URL>http://www.amazon.com/review/product/1430218592%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1430218592</URL></ItemLink><ItemLink><Description>All
82
+ Offers</Description><URL>http://www.amazon.com/gp/offer-listing/1430218592%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1430218592</URL></ItemLink></ItemLinks><ItemAttributes><Author>Jack
83
+ Nutting</Author><Author>Dave Mark</Author><Author>Jeff LaMarche</Author><Manufacturer>Apress</Manufacturer><ProductGroup>Book</ProductGroup><Title>Learn
84
+ Cocoa on the Mac (Learn Series)</Title></ItemAttributes></Item></Items></SimilarityLookupResponse>'
58
85
  http_version: '1.1'
data/spec/config_spec.rb CHANGED
@@ -4,7 +4,7 @@ module ASIN
4
4
  describe ASIN do
5
5
  context "configuration" do
6
6
  it "should fail without secret and key" do
7
- expect { @helper.lookup 'bla' }.should raise_error(ArgumentError, "you are missing mandatory configuration options. please set [:secret, :key]")
7
+ expect { @helper.lookup 'bla' }.should raise_error(ArgumentError, "you are missing mandatory configuration options. please set [:secret, :key, :associate_tag]")
8
8
  end
9
9
 
10
10
  it "should fail with wrong configuration key" do
data/spec/search_spec.rb CHANGED
@@ -4,7 +4,8 @@ module ASIN
4
4
  describe ASIN do
5
5
  context "lookup and search" do
6
6
  before do
7
- @helper.configure :secret => @secret, :key => @key
7
+ options = {:secret => @secret, :key => @key, :associate_tag => @tag}
8
+ @helper.configure options
8
9
  end
9
10
 
10
11
  it "should lookup a book", :vcr do
@@ -18,8 +19,8 @@ module ASIN
18
19
  item.asin.should eql(ANY_ASIN)
19
20
  item.title.should =~ /Learn Objective/
20
21
  item.amount.should eql(3999)
21
- item.details_url.should eql('http://www.amazon.com/Learn-Objective-C-Mac-Mark-Dalrymple/dp/1430218150%3FSubscriptionId%3DAKIAJFA5X7RTOKFNPVZQ%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1430218150')
22
- item.image_url.should eql('http://ecx.images-amazon.com/images/I/41kq5bDvnUL._SL500_.jpg')
22
+ item.details_url.should eql("http://www.amazon.com/Learn-Objective-C-Mac-Series/dp/1430218150%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1430218150")
23
+ item.image_url.should eql("http://ecx.images-amazon.com/images/I/41kq5bDvnUL.jpg")
23
24
  item.review.should =~ /Take your coding skills to the next level/
24
25
  end
25
26
 
@@ -29,16 +30,13 @@ module ASIN
29
30
  item = items.first
30
31
  item.asin.should eql(ANY_ASIN)
31
32
  item.title.should =~ /Learn Objective/
32
- item.raw.include?("AlternateVersions").should eql(true)
33
- item.raw["AlternateVersions"].length.should eql(1)
34
- item.raw["AlternateVersions"]["AlternateVersion"]["Binding"].should eql("Kindle Edition")
35
33
  end
36
34
 
37
35
  it "should lookup multiple books", :vcr do
38
36
  items = @helper.lookup(ANY_ASIN, ANY_OTHER_ASIN)
39
37
 
40
- items.last.title.should =~ /Learn Objective/
41
- items.first.title.should =~ /Beginning iPhone Development/
38
+ items.last.title.should =~ /Beginning iPhone Development/
39
+ items.first.title.should =~ /Learn Objective-C/
42
40
  end
43
41
 
44
42
  it "should return a custom item class", :vcr do
@@ -77,7 +75,7 @@ module ASIN
77
75
  it "should search_keywords a book with fulltext", :vcr do
78
76
  items = @helper.search_keywords 'Learn', 'Objective-C'
79
77
  items.should have(10).things
80
- items.first.title.should =~ /Programming in Objective-C/
78
+ items.first.title.should =~ /Learn Objective-C /
81
79
  end
82
80
 
83
81
  it "should search_keywords never mind music", :vcr do
@@ -4,19 +4,20 @@ module ASIN
4
4
  describe ASIN do
5
5
  context "similarity" do
6
6
  before do
7
- @helper.configure :secret => @secret, :key => @key
7
+ options = {:secret => @secret, :key => @key, :associate_tag => @tag}
8
+ @helper.configure options
8
9
  end
9
10
 
10
11
  it "should find similar items", :vcr do
11
12
  items = @helper.similar(ANY_ASIN)
12
13
  items.should have(10).elements
13
- items.first.title.should =~ /Learn C on the Mac/
14
+ items.first.title.should =~ /Programming in Objective-C/
14
15
  end
15
16
 
16
17
  it "should find similar items for multiple asins and different config", :vcr do
17
18
  items = @helper.similar(ANY_ASIN, ANY_OTHER_ASIN, :SimilarityType => :Intersection, :ResponseGroup => :Small)
18
- items.should have(2).elements
19
- items.first.title.should =~ /Beginning iPhone 4 Development/
19
+ items.should have(5).elements
20
+ items.first.title.should =~ /Beginning iOS 5 Development/
20
21
  end
21
22
  end
22
23
  end
data/spec/spec_helper.rb CHANGED
@@ -43,10 +43,12 @@ RSpec.configure do |config|
43
43
  @helper.configure :logger => nil
44
44
 
45
45
  @secret = ENV['ASIN_SECRET']
46
- @key = ENV['ASIN_KEY']
46
+ @key = ENV['ASIN_KEY']
47
+ @tag = ENV['ASIN_TAG']
47
48
  end
48
49
  end
49
50
 
50
51
  # setup for travis-ci
51
52
  ENV['ASIN_SECRET'] ||= 'any_secret'
52
53
  ENV['ASIN_KEY'] ||= 'any_key'
54
+ ENV['ASIN_TAG'] ||= 'any_tag'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-02 00:00:00.000000000 Z
12
+ date: 2012-09-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: crack
16
- requirement: &70302146031160 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0.3'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70302146031160
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '0.3'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: hashie
27
- requirement: &70302146030660 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ~>
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '1.1'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70302146030660
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '1.1'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: httpi
38
- requirement: &70302146030200 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ~>
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '0.9'
44
54
  type: :runtime
45
55
  prerelease: false
46
- version_requirements: *70302146030200
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '0.9'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: confiture
49
- requirement: &70302146029740 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ~>
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: '0.1'
55
70
  type: :runtime
56
71
  prerelease: false
57
- version_requirements: *70302146029740
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '0.1'
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: httpclient
60
- requirement: &70302146029260 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ~>
@@ -65,10 +85,15 @@ dependencies:
65
85
  version: 2.2.3
66
86
  type: :development
67
87
  prerelease: false
68
- version_requirements: *70302146029260
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 2.2.3
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: rash
71
- requirement: &70302146028800 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ~>
@@ -76,10 +101,15 @@ dependencies:
76
101
  version: 0.3.1
77
102
  type: :development
78
103
  prerelease: false
79
- version_requirements: *70302146028800
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 0.3.1
80
110
  - !ruby/object:Gem::Dependency
81
111
  name: rake
82
- requirement: &70302146028340 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
83
113
  none: false
84
114
  requirements:
85
115
  - - ~>
@@ -87,10 +117,15 @@ dependencies:
87
117
  version: 0.9.2.2
88
118
  type: :development
89
119
  prerelease: false
90
- version_requirements: *70302146028340
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 0.9.2.2
91
126
  - !ruby/object:Gem::Dependency
92
127
  name: vcr
93
- requirement: &70302146027880 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
94
129
  none: false
95
130
  requirements:
96
131
  - - ~>
@@ -98,10 +133,15 @@ dependencies:
98
133
  version: 1.11.3
99
134
  type: :development
100
135
  prerelease: false
101
- version_requirements: *70302146027880
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ~>
140
+ - !ruby/object:Gem::Version
141
+ version: 1.11.3
102
142
  - !ruby/object:Gem::Dependency
103
143
  name: webmock
104
- requirement: &70302146043800 !ruby/object:Gem::Requirement
144
+ requirement: !ruby/object:Gem::Requirement
105
145
  none: false
106
146
  requirements:
107
147
  - - ~>
@@ -109,10 +149,15 @@ dependencies:
109
149
  version: 1.8.7
110
150
  type: :development
111
151
  prerelease: false
112
- version_requirements: *70302146043800
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ~>
156
+ - !ruby/object:Gem::Version
157
+ version: 1.8.7
113
158
  - !ruby/object:Gem::Dependency
114
159
  name: rspec
115
- requirement: &70302146043340 !ruby/object:Gem::Requirement
160
+ requirement: !ruby/object:Gem::Requirement
116
161
  none: false
117
162
  requirements:
118
163
  - - ~>
@@ -120,10 +165,15 @@ dependencies:
120
165
  version: 2.7.0
121
166
  type: :development
122
167
  prerelease: false
123
- version_requirements: *70302146043340
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ~>
172
+ - !ruby/object:Gem::Version
173
+ version: 2.7.0
124
174
  - !ruby/object:Gem::Dependency
125
175
  name: fuubar
126
- requirement: &70302146042880 !ruby/object:Gem::Requirement
176
+ requirement: !ruby/object:Gem::Requirement
127
177
  none: false
128
178
  requirements:
129
179
  - - ~>
@@ -131,10 +181,15 @@ dependencies:
131
181
  version: 0.0.5
132
182
  type: :development
133
183
  prerelease: false
134
- version_requirements: *70302146042880
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ~>
188
+ - !ruby/object:Gem::Version
189
+ version: 0.0.5
135
190
  - !ruby/object:Gem::Dependency
136
191
  name: pry
137
- requirement: &70302146042420 !ruby/object:Gem::Requirement
192
+ requirement: !ruby/object:Gem::Requirement
138
193
  none: false
139
194
  requirements:
140
195
  - - ~>
@@ -142,7 +197,12 @@ dependencies:
142
197
  version: 0.9.9
143
198
  type: :development
144
199
  prerelease: false
145
- version_requirements: *70302146042420
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ~>
204
+ - !ruby/object:Gem::Version
205
+ version: 0.9.9
146
206
  description: Amazon Simple INterface.
147
207
  email:
148
208
  - phoetmail@googlemail.com
@@ -154,10 +214,10 @@ files:
154
214
  - .gitignore
155
215
  - .rvmrc
156
216
  - .travis.yml
157
- - CHANGELOG.rdoc
217
+ - CHANGELOG.md
158
218
  - Gemfile
159
219
  - Gemfile.lock
160
- - README.rdoc
220
+ - README.md
161
221
  - asin.gemspec
162
222
  - lib/asin.rb
163
223
  - lib/asin/client.rb
@@ -191,7 +251,6 @@ files:
191
251
  - spec/cassettes/asin/lookup_and_search_should_search_never_mind_music.yml
192
252
  - spec/cassettes/asin/similarity_should_find_similar_items.yml
193
253
  - spec/cassettes/asin/similarity_should_find_similar_items_for_multiple_asins_and_different_config.yml
194
- - spec/cassettes/asin/similarity_should_lookup_for_similar_items.yml
195
254
  - spec/config_spec.rb
196
255
  - spec/search_spec.rb
197
256
  - spec/similarity_spec.rb
@@ -216,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
275
  version: '0'
217
276
  requirements: []
218
277
  rubyforge_project: asin
219
- rubygems_version: 1.8.17
278
+ rubygems_version: 1.8.24
220
279
  signing_key:
221
280
  specification_version: 3
222
281
  summary: Simple interface to AWS Lookup, Search and Cart operations.
@@ -245,7 +304,6 @@ test_files:
245
304
  - spec/cassettes/asin/lookup_and_search_should_search_never_mind_music.yml
246
305
  - spec/cassettes/asin/similarity_should_find_similar_items.yml
247
306
  - spec/cassettes/asin/similarity_should_find_similar_items_for_multiple_asins_and_different_config.yml
248
- - spec/cassettes/asin/similarity_should_lookup_for_similar_items.yml
249
307
  - spec/config_spec.rb
250
308
  - spec/search_spec.rb
251
309
  - spec/similarity_spec.rb