11 (only (rl3 aws configuration)
15 (only (rl3 aws awscredentials)
16 aws-credentials-associate-tag
17 aws-credentials-secret-key
18 aws-credentials-access-key)
22 http-invoke http-ascii-port-from-binary-port)
23 (only (rl3 web pipes htmlprag)
25 (only (rl3 types dates)
27 (only (rl3 aws awsauth)
30 (only (rl3 aws s3 s3headers)
31 host-header date-header)
32 (only (rl3 web uri url parms)
34 (only (rl3 aws s3 s3headers)
37 (define ecs-host (aws-configuration 'host))
39 (define ecshost-header (host-header ecs-host))
42 '( ("Operation" . "ItemSearch")
43 ("SearchIndex" . "KindleStore")))
45 (define itemlookup-parms
46 '(("Operation" . "ItemLookup")))
50 `(("Service" . "AWSECommerceService")
51 ("Version" . "2008-03-03")
52 ("Associate-Tag" . ,(aws-credentials-associate-tag creds))
53 ("AWSAccessKeyId" . ,(aws-credentials-access-key creds)))))
55 (define keyword-search
57 (let ((parms (append search-parms (ecs-parms creds)
58 `(("Keywords" . ,words)))))
59 (let ((uri (make-uri "http" #f ecs-host #f "/onca/xml" (parms->query parms) "")))
60 (let-values (((hdrs hip) (http-invoke 'GET (uri->string uri)
62 (let ((tip (http-ascii-port-from-binary-port hip)))
63 (let ((results (html->sxml tip)))
69 (let ((parms (append itemlookup-parms (ecs-parms creds)
72 ("ResponseGroup" . "SalesRank,Small,EditorialReview,Reviews")))))
73 (let ((uri (make-uri "http" #f ecs-host #f "/onca/xml" (parms->query parms) "")))
74 (let-values (((hdrs hip) (http-invoke 'GET (uri->string uri)
76 (let ((tip (http-ascii-port-from-binary-port hip)))
77 (let ((results (html->sxml tip)))