Esempio n. 1
0
        public static void Run()
        {
            dynamic amazon = new RestClient(AppSettings.Default.AmazonUri, RestClientMode.Xml);
            amazon.subscriptionID = AppSettings.Default.AmazonSubscriptionID;

            dynamic searchOptions = new JsonObject();
            searchOptions.SearchIndex = "Books";
            searchOptions.Keywords = "Dynamic Programming";

            dynamic bookList = amazon.ItemSearch(searchOptions);

            foreach (dynamic book in bookList.SelectAll("Item")) {
                Console.WriteLine(book.ASIN + " : " + book.ItemAttributes.Title);
            }
        }
Esempio 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);
            }
        }
Esempio n. 3
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);
            }
        }