public SearchNode GetSearchNode(long searchNodeId) { SearchNode result = new SearchNode() { Id = searchNodeId }; var authentication = new AmazonAuthentication(); authentication.AccessKey = this._amazonAccessKey; authentication.SecretKey = this._amazonSecretKey; var wrapper = new AmazonWrapper(authentication, AmazonEndpoint.IT, this._amazonPartnerId); wrapper.ErrorReceived += (errorResonse) => { _logger.LogError(errorResonse.Error.Message); }; BrowseNodeLookupResponse nodelookup = wrapper.BrowseNodeLookup(searchNodeId, AmazonResponseGroup.BrowseNodeInfo); if (nodelookup.BrowseNodes.Request.IsValid == "True") { result.Name = nodelookup.BrowseNodes.BrowseNode.Name; foreach (var item in nodelookup.BrowseNodes.BrowseNode.Children) { result.SearchSubNodes.Add(GetSearchNode(Convert.ToInt64(item.BrowseNodeId))); } } return(result); }
static void BrowseNodeLookupRequest2(AmazonAuthentication authentication) { Console.WriteLine("BrowseNodeLookup - BrowseNodes"); Console.WriteLine("------------------------------------------"); var wrapper = new AmazonWrapper(authentication, AmazonEndpoint.DE); var result = wrapper.BrowseNodeLookup(78193031, AmazonResponseGroup.BrowseNodeInfo); foreach (var item in result.BrowseNodes.BrowseNode.Children) { Console.WriteLine(item.BrowseNodeId); } Console.WriteLine("------------------------------------------"); }
static void BrowseNodeLookupRequest(AmazonAuthentication authentication) { //http://docs.aws.amazon.com/AWSECommerceService/latest/DG/localevalues.html Console.WriteLine("BrowseNodeLookup"); Console.WriteLine("------------------------------------------"); var wrapper = new AmazonWrapper(authentication, AmazonEndpoint.DE); var result = wrapper.BrowseNodeLookup(569604, AmazonResponseGroup.Large); foreach (var item in result.BrowseNodes.BrowseNode.Children) { Console.WriteLine(item.BrowseNodeId); } //Console.WriteLine("found {0} items", result.Items.Item.Length); Console.WriteLine("------------------------------------------"); }
static void BrowseNodeLookupRequest1(AmazonAuthentication authentication) { Console.WriteLine("BrowseNodeLookup - TopSellers"); Console.WriteLine("------------------------------------------"); var wrapper = new AmazonWrapper(authentication, AmazonEndpoint.DE); var result = wrapper.BrowseNodeLookup(78193031, AmazonResponseGroup.TopSellers); foreach (var item in result.BrowseNodes.BrowseNode.TopSellers.TopSeller) { Console.WriteLine("{0} {1}", item.ASIN, item.Title); } foreach (var item in result.BrowseNodes.BrowseNode.TopItemSet.TopItem) { Console.WriteLine("{0} {1} {2}", item.ASIN, item.ProductGroup, item.Title); } Console.WriteLine("------------------------------------------"); }
public void SearchTopSellerItems(string keywords, long searchNode, int minPrice, int maxPrice, bool searchSubNodes, Enums.SearchSort searchSort, Enums.SearchSortOrder searchSortOrder) { var authentication = new AmazonAuthentication(); authentication.AccessKey = this._amazonAccessKey; authentication.SecretKey = this._amazonSecretKey; var wrapper = new AmazonWrapper(authentication, AmazonEndpoint.IT, this._amazonPartnerId); wrapper.ErrorReceived += (errorResonse) => { _logger.LogError(errorResonse.Error.Message); }; var searchNodeTopSeller = wrapper.BrowseNodeLookup(searchNode, AmazonResponseGroup.BrowseNodeInfo | AmazonResponseGroup.TopSellers); var test33 = wrapper.ItemLookupOperation(new List <string> { "B00PAZYAT2", "B007SGHF3Y" }, AmazonResponseGroup.Small | AmazonResponseGroup.BrowseNodes | AmazonResponseGroup.SalesRank | AmazonResponseGroup.ItemAttributes); test33.ParameterDictionary.Add("MerchantId", "Amazon"); var xmlResponseTT = wrapper.Request(test33); var parsedTT = XmlHelper.ParseXml <ItemLookupResponse>(xmlResponseTT.Content); }