/// <summary> /// This class gets detailed information about the skin for the specified ID. Such as price, float, overpayment, stickers, number of items on the bot, skin 3d model, etc. /// </summary> public static List <CSMSkinsOnSale> GetCSMItemById(int id) { try { List <CSMSkinsOnSale> meny_data = new List <CSMSkinsOnSale>(); HttpClient client = new HttpClient(); Encoding.GetEncoding("ISO-8859-1"); client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8"); var data = client.GetAsync(csmlib).Result.Content.ReadAsStringAsync().Result; var output = CovertItems.FromJson(data); foreach (var t in output) { if (id == t.O) { meny_data.Add(new CSMSkinsOnSale { Ai = t.Ai, O = t.O, Ar = t.Ar, T = t.T, B = t.B, Bi = t.Bi, Bl = t.Bl, Bs = t.Bs, Cp = t.Cp, D = t.D, F = t.F, Fa = t.Fa, G = t.G, Id = t.Id, /*Mf = t.Mf,*/ N = t.N, P = t.P, Pd = t.Pd, Pop = t.Pop, Ps = t.Ps, Pt = t.Pt, S = t.S, Ss = t.Ss, Ui = t.Ui, Vi = t.Vi }); } } return(meny_data); } catch (HttpRequestException e) { Console.WriteLine(e.Message); return(null); } }
/// <summary> /// This class gets detailed information about skins already on sale. Such as price, float, overpayment, stickers, number of items on the bot, skin 3d model, etc. /// </summary> public static CSMSkinsOnSale[] GetCSMItems() { try { HttpClient client = new HttpClient(); Encoding.GetEncoding("ISO-8859-1"); client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8"); var data = client.GetAsync(csmlib).Result.Content.ReadAsStringAsync().Result; var output = CovertItems.FromJson(data); return(output); } catch (HttpRequestException e) { Console.WriteLine(e.Message); return(null); } }