//"B076GZ3JFC" public static List <PriceSourceItemOld> Search(string term, AmazonSearchIndex amazonSearchIndex = AmazonSearchIndex.All, AmazonEndpoint?endpoint = null) { List <PriceSourceItemOld> results = new List <PriceSourceItemOld>(); List <Endpoint> endpointsToSearch = new List <Endpoint>(); if (endpoint != null) { endpointsToSearch.Add(Endpoints.Get(endpoint.Value)); } else { endpointsToSearch.AddRange(Endpoints.EndpointsList); } foreach (var endpointItem in endpointsToSearch) { var authentication = new AmazonAuthentication(); authentication.AccessKey = endpointItem.accessKey; authentication.SecretKey = endpointItem.secreteKey; endpoint = (AmazonEndpoint)Enum.Parse(typeof(AmazonEndpoint), endpointItem.endpointCode); var wrapper = new AmazonWrapper(authentication, endpoint.Value, endpointItem.merchantId); string searchTerm = "ASUS DUAL-RX580-O8G Radeon RX 580 8 GB GDDR5"; //string searchTerm = //"B076GZ3JFC"; AmazonItemResponse result = wrapper.Search(term, AmazonSearchIndex.All); results.AddRange(result.ToPriceSourceItems()); } return(results); }
public AmazonItemSearchOperation ItemSearchOperation(string search, AmazonSearchIndex amazonSearchIndex = AmazonSearchIndex.All, AmazonResponseGroup amazonResponseGroup = AmazonResponseGroup.Large) { var operation = new AmazonItemSearchOperation(); operation.ResponseGroup(amazonResponseGroup); operation.Keywords(search); operation.SearchIndex(amazonSearchIndex); operation.AssociateTag(this._associateTag); return(operation); }
public void SearchIndex(AmazonSearchIndex searchIndex) { if (this.ParameterDictionary.ContainsKey("SearchIndex")) { this.ParameterDictionary["SearchIndex"] = searchIndex.ToString(); return; } this.ParameterDictionary.Add("SearchIndex", searchIndex.ToString()); }
public AmazonItemResponse Search(string search, AmazonSearchIndex searchIndex = AmazonSearchIndex.All, AmazonResponseGroup responseGroup = AmazonResponseGroup.Large) { var operation = this.ItemSearchOperation(search, searchIndex, responseGroup); var webResponse = this.Request(operation); if (webResponse.StatusCode == HttpStatusCode.OK) { return(XmlHelper.ParseXml <ItemSearchResponse>(webResponse.Content)); } else { var errorResponse = XmlHelper.ParseXml <ItemSearchErrorResponse>(webResponse.Content); this.ErrorReceived?.Invoke(errorResponse); } return(null); }
public async Task <AmazonItemResponse> SearchAsync(string search, AmazonSearchIndex searchIndex = AmazonSearchIndex.All, AmazonResponseGroup responseGroup = AmazonResponseGroup.Large) { var requestParams = ItemSearchOperation(search, searchIndex, responseGroup); var webResponse = await this.RequestAsync(requestParams); if (webResponse.StatusCode == HttpStatusCode.OK) { return(XmlHelper.ParseXml <ItemSearchResponse>(webResponse.Content)); } else { var errorResponse = XmlHelper.ParseXml <ItemSearchErrorResponse>(webResponse.Content); this.ErrorReceived?.Invoke(errorResponse); } return(null); }
public virtual PartialViewResult Search(String searchTerms, AmazonSearchIndex category) { var results = _amazonService.Search(searchTerms, category); return(PartialView("_SearchResults", results)); }
public void SearchIndex(AmazonSearchIndex searchIndex) { this.AddOrReplace("SearchIndex", searchIndex.ToString()); }
public AmazonItemResponse Search(String searchTerms, AmazonSearchIndex indexToSearch, AmazonResponseGroup responseGroup = AmazonResponseGroup.Large) { return(_requestWrapper.Search(searchTerms, indexToSearch, responseGroup)); }