private async Task <RsExchangeData> GetItemByIdAsync(long id) { //var client = new HttpClient(); string url = "https://rsbuddy.com/exchange/summary.json"; var responds = await _client.GetStringAsync(url); var result = RsExchangeData.FromJson(responds); var data = result[id.ToString()]; return(data); }
public async Task <IActionResult> Index() { var url = "https://rsbuddy.com/exchange/summary.json"; var responds = await _client.GetStringAsync(url); var result = RsExchangeData.FromJson(responds); var exchangeList = result.Select(x => x.Value).ToList(); var natPriceData = await GetPriceDataById(561); var natPrice = natPriceData.Overall; var filteredList = FilterExchangeDataList(exchangeList, natPrice); var alchList = await GetHighAlchViewModelList(filteredList, natPrice); var displayViewModel = SetDisplayViewModel(alchList, natPrice); return(View(displayViewModel)); }
public async Task <IActionResult> BestItems() { var url = "https://rsbuddy.com/exchange/summary.json"; var responds = await _client.GetStringAsync(url); var result = RsExchangeData.FromJson(responds); //var url2 = "https://rsbuddy.com/exchange/names.json"; //var responds2 = await _client.GetStringAsync(url2); string path = @"./Data/RSStorePriceDetials.json"; //var data = JsonConvert.DeserializeObject<StorePriceData>(System.IO.File.ReadAllText(path)); var data = System.IO.File.ReadAllText(path); var result2 = StorePriceData.FromJson(data); return(View()); }