Apiki_Buscape_API.Apiki_Buscape_API.TopProducts C# (CSharp) Method

TopProducts() public method

Recupera os produtos mais populares no BúscaPé
public TopProducts ( string callback ) : string
callback string Função de retorno a ser executada caso esteja usando json
return string
        public string TopProducts(string callback)
        {
            string param = string.Empty;
            param = (this.format.Equals("json")) ? "?format=json" : string.Empty;
            param += (!string.IsNullOrEmpty(param) && !string.IsNullOrEmpty(callback)) ? "&callback=" + callback : string.Empty;
            if (!string.IsNullOrEmpty(param))
                param += (!string.IsNullOrEmpty(this.sourceId)) ? "&sourceId=" + this.sourceId : string.Empty;
            else
                param += (!string.IsNullOrEmpty(this.sourceId)) ? "?sourceId=" + this.sourceId : string.Empty;

            string url = string.Format("http://{0}.buscape.com/service/{1}/{2}/{3}/{4}", this.server, Services.topProducts, this.applicationId, this.countryCode, param);

            return GetContent(url);
        }