asin 0.8.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +1 -2
- data/{CHANGELOG.rdoc → CHANGELOG.md} +12 -12
- data/Gemfile.lock +6 -0
- data/README.md +153 -0
- data/lib/asin/client.rb +6 -5
- data/lib/asin/configuration.rb +9 -20
- data/lib/asin/version.rb +1 -1
- data/spec/browse_node_spec.rb +2 -1
- data/spec/cart_spec.rb +2 -1
- data/spec/cassettes/asin/asin_cart_with_an_existing_cart_should_add_items_to_a_cart.yml +62 -46
- data/spec/cassettes/asin/asin_cart_with_an_existing_cart_should_clear_a_cart.yml +60 -45
- data/spec/cassettes/asin/asin_cart_with_an_existing_cart_should_get_a_cart.yml +61 -46
- data/spec/cassettes/asin/asin_cart_with_an_existing_cart_should_update_a_cart.yml +64 -49
- data/spec/cassettes/asin/browse_node_should_lookup_a_browse_node.yml +28 -22
- data/spec/cassettes/asin/cart_should_create_a_cart.yml +30 -23
- data/spec/cassettes/asin/lookup_and_search_should_have_metadata.yml +70 -61
- data/spec/cassettes/asin/lookup_and_search_should_lookup_a_book.yml +70 -61
- data/spec/cassettes/asin/lookup_and_search_should_lookup_multiple_books.yml +120 -111
- data/spec/cassettes/asin/lookup_and_search_should_lookup_multiple_response_groups.yml +37 -32
- data/spec/cassettes/asin/lookup_and_search_should_return_a_custom_item_class.yml +70 -61
- data/spec/cassettes/asin/lookup_and_search_should_return_a_mash_value.yml +70 -61
- data/spec/cassettes/asin/lookup_and_search_should_return_a_rash_value.yml +70 -61
- data/spec/cassettes/asin/lookup_and_search_should_return_a_raw_value.yml +70 -61
- data/spec/cassettes/asin/lookup_and_search_should_search_keywords_a_book_with_fulltext.yml +573 -524
- data/spec/cassettes/asin/lookup_and_search_should_search_keywords_and_handle_a_single_result.yml +45 -37
- data/spec/cassettes/asin/lookup_and_search_should_search_keywords_never_mind_music.yml +109 -104
- data/spec/cassettes/asin/lookup_and_search_should_search_music.yml +28 -26
- data/spec/cassettes/asin/lookup_and_search_should_search_never_mind_music.yml +112 -110
- data/spec/cassettes/asin/similarity_should_find_similar_items.yml +500 -488
- data/spec/cassettes/asin/similarity_should_find_similar_items_for_multiple_asins_and_different_config.yml +53 -26
- data/spec/config_spec.rb +1 -1
- data/spec/search_spec.rb +7 -9
- data/spec/similarity_spec.rb +5 -4
- data/spec/spec_helper.rb +3 -1
- metadata +89 -31
- data/README.rdoc +0 -169
- 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=
|
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
|
-
|
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"
|
33
|
-
Name="
|
34
|
-
|
35
|
-
|
36
|
-
Name="
|
37
|
-
Value="
|
38
|
-
|
39
|
-
|
40
|
-
Details</Description><URL>http://www.amazon.com/Beginning-
|
41
|
-
To Baby Registry</Description><URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%
|
42
|
-
To Wedding Registry</Description><URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%
|
43
|
-
To Wishlist</Description><URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%
|
44
|
-
A Friend</Description><URL>http://www.amazon.com/gp/pdp/taf/
|
45
|
-
Customer Reviews</Description><URL>http://www.amazon.com/review/product/
|
46
|
-
Offers</Description><URL>http://www.amazon.com/gp/offer-listing/
|
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
|
-
|
49
|
-
Details</Description><URL>http://www.amazon.com/Programming-Objective-C-
|
50
|
-
To Baby Registry</Description><URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%
|
51
|
-
To Wedding Registry</Description><URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%
|
52
|
-
To Wishlist</Description><URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%
|
53
|
-
A Friend</Description><URL>http://www.amazon.com/gp/pdp/taf/
|
54
|
-
Customer Reviews</Description><URL>http://www.amazon.com/review/product/
|
55
|
-
Offers</Description><URL>http://www.amazon.com/gp/offer-listing/
|
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
|
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
|
-
|
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(
|
22
|
-
item.image_url.should eql(
|
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 =~ /
|
41
|
-
items.first.title.should =~ /
|
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 =~ /
|
78
|
+
items.first.title.should =~ /Learn Objective-C /
|
81
79
|
end
|
82
80
|
|
83
81
|
it "should search_keywords never mind music", :vcr do
|
data/spec/similarity_spec.rb
CHANGED
@@ -4,19 +4,20 @@ module ASIN
|
|
4
4
|
describe ASIN do
|
5
5
|
context "similarity" do
|
6
6
|
before do
|
7
|
-
|
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 =~ /
|
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(
|
19
|
-
items.first.title.should =~ /Beginning
|
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
|
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.
|
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-
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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.
|
217
|
+
- CHANGELOG.md
|
158
218
|
- Gemfile
|
159
219
|
- Gemfile.lock
|
160
|
-
- README.
|
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.
|
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
|