amazon_product 3.0.0.pre.1 → 3.0.0.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +12 -8
- data/lib/amazon_product.rb +0 -1
- data/lib/amazon_product.rbc +439 -0
- data/lib/amazon_product/error.rbc +197 -0
- data/lib/amazon_product/hash_builder.rbc +788 -0
- data/lib/amazon_product/locale.rb +5 -2
- data/lib/amazon_product/locale.rbc +647 -0
- data/lib/amazon_product/operations.rbc +1660 -0
- data/lib/amazon_product/request.rb +76 -20
- data/lib/amazon_product/request.rbc +3389 -0
- data/lib/amazon_product/response.rb +4 -4
- data/lib/amazon_product/response.rbc +1168 -0
- data/lib/amazon_product/version.rb +1 -1
- data/lib/amazon_product/version.rbc +130 -0
- data/spec/amazon_product/hash_builder_spec.rbc +863 -0
- data/spec/amazon_product/request_spec.rb +111 -15
- data/spec/amazon_product/request_spec.rbc +7210 -0
- data/spec/amazon_product/response_spec.rb +3 -4
- data/spec/amazon_product/response_spec.rbc +2250 -0
- data/spec/spec_helper.rbc +204 -0
- metadata +21 -8
- data/lib/amazon_product/synchrony.rb +0 -34
- data/spec/amazon_product/synchrony_spec.rb +0 -49
data/README.md
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Amazon Product
|
2
2
|
|
3
|
-
Amazon Product is a Ruby wrapper to the [Amazon Product Advertising API] [
|
3
|
+
Amazon Product is a [Nokogiri][1]-backed Ruby wrapper to the [Amazon Product Advertising API] [2].
|
4
4
|
|
5
5
|
[![travis](https://secure.travis-ci.org/hakanensari/amazon_product.png)](http://travis-ci.org/hakanensari/amazon_product)
|
6
6
|
|
7
7
|
## Usage
|
8
8
|
|
9
|
-
Require.
|
10
|
-
|
11
9
|
Set up a request.
|
12
10
|
|
11
|
+
require "amazon_product"
|
12
|
+
|
13
13
|
request = AmazonProduct["us"]
|
14
14
|
|
15
15
|
request.configure do |c|
|
@@ -24,7 +24,7 @@ Look up a product.
|
|
24
24
|
:item_id' => '0679753354' }
|
25
25
|
response = request.get
|
26
26
|
|
27
|
-
[Or use a shorthand] [
|
27
|
+
[Or use a shorthand] [3].
|
28
28
|
|
29
29
|
response = req.find('0679753354')
|
30
30
|
|
@@ -36,10 +36,14 @@ Quickly drop down to a particular node.
|
|
36
36
|
|
37
37
|
response['Item']
|
38
38
|
|
39
|
-
Please see
|
39
|
+
[Please see the project page] [4] for more detailed info.
|
40
40
|
|
41
|
-
|
41
|
+
## Branding is a delicate art
|
42
42
|
|
43
|
-
[
|
43
|
+
Should you wonder, Amazon Product descends from [Sucker][5]. While I like the vacuum metaphor, the name felt tiring after a while.
|
44
44
|
|
45
|
-
[
|
45
|
+
[1]: http://nokogiri.org/
|
46
|
+
[2]: https://affiliate-program.amazon.co.uk/gp/advertising/api/detail/main.html
|
47
|
+
[3]: https://github.com/hakanensari/amazon_product/blob/master/lib/amazon_product/operations.rb
|
48
|
+
[4]: http://code.papercavalier.com/amazon_product/
|
49
|
+
[5]: http://github.com/papercavalier/sucker/
|
data/lib/amazon_product.rb
CHANGED
@@ -0,0 +1,439 @@
|
|
1
|
+
!RBIX
|
2
|
+
6235178746665710376
|
3
|
+
x
|
4
|
+
M
|
5
|
+
1
|
6
|
+
n
|
7
|
+
n
|
8
|
+
x
|
9
|
+
10
|
10
|
+
__script__
|
11
|
+
i
|
12
|
+
109
|
13
|
+
5
|
14
|
+
7
|
15
|
+
0
|
16
|
+
64
|
17
|
+
47
|
18
|
+
49
|
19
|
+
1
|
20
|
+
1
|
21
|
+
15
|
22
|
+
5
|
23
|
+
7
|
24
|
+
2
|
25
|
+
64
|
26
|
+
47
|
27
|
+
49
|
28
|
+
1
|
29
|
+
1
|
30
|
+
15
|
31
|
+
5
|
32
|
+
7
|
33
|
+
3
|
34
|
+
64
|
35
|
+
47
|
36
|
+
49
|
37
|
+
1
|
38
|
+
1
|
39
|
+
15
|
40
|
+
5
|
41
|
+
7
|
42
|
+
4
|
43
|
+
64
|
44
|
+
47
|
45
|
+
49
|
46
|
+
1
|
47
|
+
1
|
48
|
+
15
|
49
|
+
5
|
50
|
+
7
|
51
|
+
5
|
52
|
+
64
|
53
|
+
47
|
54
|
+
49
|
55
|
+
1
|
56
|
+
1
|
57
|
+
15
|
58
|
+
5
|
59
|
+
7
|
60
|
+
6
|
61
|
+
64
|
62
|
+
47
|
63
|
+
49
|
64
|
+
1
|
65
|
+
1
|
66
|
+
15
|
67
|
+
5
|
68
|
+
7
|
69
|
+
7
|
70
|
+
64
|
71
|
+
47
|
72
|
+
49
|
73
|
+
1
|
74
|
+
1
|
75
|
+
15
|
76
|
+
5
|
77
|
+
7
|
78
|
+
8
|
79
|
+
64
|
80
|
+
47
|
81
|
+
49
|
82
|
+
1
|
83
|
+
1
|
84
|
+
15
|
85
|
+
5
|
86
|
+
7
|
87
|
+
9
|
88
|
+
64
|
89
|
+
47
|
90
|
+
49
|
91
|
+
1
|
92
|
+
1
|
93
|
+
15
|
94
|
+
99
|
95
|
+
7
|
96
|
+
10
|
97
|
+
65
|
98
|
+
49
|
99
|
+
11
|
100
|
+
2
|
101
|
+
13
|
102
|
+
99
|
103
|
+
12
|
104
|
+
7
|
105
|
+
12
|
106
|
+
12
|
107
|
+
7
|
108
|
+
13
|
109
|
+
12
|
110
|
+
65
|
111
|
+
12
|
112
|
+
49
|
113
|
+
14
|
114
|
+
4
|
115
|
+
15
|
116
|
+
49
|
117
|
+
12
|
118
|
+
0
|
119
|
+
15
|
120
|
+
2
|
121
|
+
11
|
122
|
+
I
|
123
|
+
6
|
124
|
+
I
|
125
|
+
0
|
126
|
+
I
|
127
|
+
0
|
128
|
+
I
|
129
|
+
0
|
130
|
+
n
|
131
|
+
p
|
132
|
+
15
|
133
|
+
s
|
134
|
+
8
|
135
|
+
net/http
|
136
|
+
x
|
137
|
+
7
|
138
|
+
require
|
139
|
+
s
|
140
|
+
8
|
141
|
+
nokogiri
|
142
|
+
s
|
143
|
+
7
|
144
|
+
openssl
|
145
|
+
s
|
146
|
+
20
|
147
|
+
amazon_product/error
|
148
|
+
s
|
149
|
+
27
|
150
|
+
amazon_product/hash_builder
|
151
|
+
s
|
152
|
+
21
|
153
|
+
amazon_product/locale
|
154
|
+
s
|
155
|
+
25
|
156
|
+
amazon_product/operations
|
157
|
+
s
|
158
|
+
22
|
159
|
+
amazon_product/request
|
160
|
+
s
|
161
|
+
23
|
162
|
+
amazon_product/response
|
163
|
+
x
|
164
|
+
13
|
165
|
+
AmazonProduct
|
166
|
+
x
|
167
|
+
11
|
168
|
+
open_module
|
169
|
+
x
|
170
|
+
15
|
171
|
+
__module_init__
|
172
|
+
M
|
173
|
+
1
|
174
|
+
n
|
175
|
+
n
|
176
|
+
x
|
177
|
+
13
|
178
|
+
AmazonProduct
|
179
|
+
i
|
180
|
+
40
|
181
|
+
5
|
182
|
+
66
|
183
|
+
45
|
184
|
+
0
|
185
|
+
1
|
186
|
+
13
|
187
|
+
71
|
188
|
+
2
|
189
|
+
47
|
190
|
+
9
|
191
|
+
23
|
192
|
+
47
|
193
|
+
49
|
194
|
+
3
|
195
|
+
0
|
196
|
+
13
|
197
|
+
47
|
198
|
+
49
|
199
|
+
4
|
200
|
+
0
|
201
|
+
15
|
202
|
+
8
|
203
|
+
26
|
204
|
+
49
|
205
|
+
2
|
206
|
+
0
|
207
|
+
38
|
208
|
+
5
|
209
|
+
15
|
210
|
+
99
|
211
|
+
7
|
212
|
+
6
|
213
|
+
7
|
214
|
+
7
|
215
|
+
65
|
216
|
+
5
|
217
|
+
49
|
218
|
+
8
|
219
|
+
4
|
220
|
+
11
|
221
|
+
I
|
222
|
+
5
|
223
|
+
I
|
224
|
+
0
|
225
|
+
I
|
226
|
+
0
|
227
|
+
I
|
228
|
+
0
|
229
|
+
n
|
230
|
+
p
|
231
|
+
9
|
232
|
+
x
|
233
|
+
4
|
234
|
+
Hash
|
235
|
+
n
|
236
|
+
x
|
237
|
+
3
|
238
|
+
new
|
239
|
+
x
|
240
|
+
8
|
241
|
+
allocate
|
242
|
+
x
|
243
|
+
10
|
244
|
+
initialize
|
245
|
+
x
|
246
|
+
9
|
247
|
+
@requests
|
248
|
+
x
|
249
|
+
2
|
250
|
+
[]
|
251
|
+
M
|
252
|
+
1
|
253
|
+
n
|
254
|
+
n
|
255
|
+
x
|
256
|
+
2
|
257
|
+
[]
|
258
|
+
i
|
259
|
+
55
|
260
|
+
39
|
261
|
+
0
|
262
|
+
20
|
263
|
+
0
|
264
|
+
14
|
265
|
+
2
|
266
|
+
49
|
267
|
+
1
|
268
|
+
1
|
269
|
+
13
|
270
|
+
10
|
271
|
+
50
|
272
|
+
15
|
273
|
+
45
|
274
|
+
2
|
275
|
+
3
|
276
|
+
13
|
277
|
+
71
|
278
|
+
4
|
279
|
+
47
|
280
|
+
9
|
281
|
+
36
|
282
|
+
47
|
283
|
+
49
|
284
|
+
5
|
285
|
+
0
|
286
|
+
13
|
287
|
+
20
|
288
|
+
0
|
289
|
+
47
|
290
|
+
49
|
291
|
+
6
|
292
|
+
1
|
293
|
+
15
|
294
|
+
8
|
295
|
+
41
|
296
|
+
20
|
297
|
+
0
|
298
|
+
49
|
299
|
+
4
|
300
|
+
1
|
301
|
+
13
|
302
|
+
18
|
303
|
+
3
|
304
|
+
49
|
305
|
+
7
|
306
|
+
2
|
307
|
+
15
|
308
|
+
8
|
309
|
+
54
|
310
|
+
18
|
311
|
+
2
|
312
|
+
16
|
313
|
+
2
|
314
|
+
11
|
315
|
+
I
|
316
|
+
6
|
317
|
+
I
|
318
|
+
1
|
319
|
+
I
|
320
|
+
1
|
321
|
+
I
|
322
|
+
1
|
323
|
+
n
|
324
|
+
p
|
325
|
+
8
|
326
|
+
x
|
327
|
+
9
|
328
|
+
@requests
|
329
|
+
x
|
330
|
+
2
|
331
|
+
[]
|
332
|
+
x
|
333
|
+
7
|
334
|
+
Request
|
335
|
+
n
|
336
|
+
x
|
337
|
+
3
|
338
|
+
new
|
339
|
+
x
|
340
|
+
8
|
341
|
+
allocate
|
342
|
+
x
|
343
|
+
10
|
344
|
+
initialize
|
345
|
+
x
|
346
|
+
3
|
347
|
+
[]=
|
348
|
+
p
|
349
|
+
5
|
350
|
+
I
|
351
|
+
-1
|
352
|
+
I
|
353
|
+
16
|
354
|
+
I
|
355
|
+
0
|
356
|
+
I
|
357
|
+
17
|
358
|
+
I
|
359
|
+
37
|
360
|
+
x
|
361
|
+
60
|
362
|
+
/Users/hakanensari/code/amazon_product/lib/amazon_product.rb
|
363
|
+
p
|
364
|
+
1
|
365
|
+
x
|
366
|
+
6
|
367
|
+
locale
|
368
|
+
x
|
369
|
+
13
|
370
|
+
attach_method
|
371
|
+
p
|
372
|
+
5
|
373
|
+
I
|
374
|
+
2
|
375
|
+
I
|
376
|
+
e
|
377
|
+
I
|
378
|
+
1d
|
379
|
+
I
|
380
|
+
16
|
381
|
+
I
|
382
|
+
28
|
383
|
+
x
|
384
|
+
60
|
385
|
+
/Users/hakanensari/code/amazon_product/lib/amazon_product.rb
|
386
|
+
p
|
387
|
+
0
|
388
|
+
x
|
389
|
+
13
|
390
|
+
attach_method
|
391
|
+
p
|
392
|
+
21
|
393
|
+
I
|
394
|
+
0
|
395
|
+
I
|
396
|
+
1
|
397
|
+
I
|
398
|
+
9
|
399
|
+
I
|
400
|
+
2
|
401
|
+
I
|
402
|
+
12
|
403
|
+
I
|
404
|
+
3
|
405
|
+
I
|
406
|
+
1b
|
407
|
+
I
|
408
|
+
5
|
409
|
+
I
|
410
|
+
24
|
411
|
+
I
|
412
|
+
6
|
413
|
+
I
|
414
|
+
2d
|
415
|
+
I
|
416
|
+
7
|
417
|
+
I
|
418
|
+
36
|
419
|
+
I
|
420
|
+
8
|
421
|
+
I
|
422
|
+
3f
|
423
|
+
I
|
424
|
+
9
|
425
|
+
I
|
426
|
+
48
|
427
|
+
I
|
428
|
+
a
|
429
|
+
I
|
430
|
+
51
|
431
|
+
I
|
432
|
+
d
|
433
|
+
I
|
434
|
+
6d
|
435
|
+
x
|
436
|
+
60
|
437
|
+
/Users/hakanensari/code/amazon_product/lib/amazon_product.rb
|
438
|
+
p
|
439
|
+
0
|