Ejemplo n.º 1
0
        public static void Run()
        {
            AmazonUriSigner signer = new AmazonUriSigner(Services.AmazonAccessKey, Services.AmazonSecretKey);

            var templatedUriRequestBuilder = new TemplatedUriRequestBuilder(new RequestFactory());

            templatedUriRequestBuilder.Uri = Services.AmazonUri;
            templatedUriRequestBuilder.SetUriTransformer(signer);

            dynamic amazon = new RestClient(
                templatedUriRequestBuilder,
                new ResponseProcessor(new StandardResultBuilder(RestService.Xml)));

            dynamic searchOptions = new JsonObject();

            searchOptions.SearchIndex = "Books";
            searchOptions.Keywords    = "Dynamic Programming";

            dynamic search   = amazon.ItemSearch(searchOptions);
            dynamic bookList = search.Result;

            foreach (dynamic book in bookList.SelectAll("Item"))
            {
                Console.WriteLine(book.ASIN + " : " + book.ItemAttributes.Title);
            }
        }
Ejemplo n.º 2
0
        public static void Run()
        {
            AmazonUriSigner signer = new AmazonUriSigner(Services.AmazonAccessKey, Services.AmazonSecretKey);
            dynamic         amazon = new RestClient(Services.AmazonUri, RestService.Xml).
                                     WithUriTransformer(signer);

            dynamic searchOptions = new JsonObject();

            searchOptions.SearchIndex = "Books";
            searchOptions.Keywords    = "Dynamic Programming";

            dynamic search   = amazon.ItemSearch(searchOptions);
            dynamic bookList = search.Result;

            foreach (dynamic book in bookList.SelectAll("Item"))
            {
                Console.WriteLine(book.ASIN + " : " + book.ItemAttributes.Title);
            }
        }