static void Main(string[] args) { Heroes.Init(); Items.Init(); MyHttpRequest request; string jSonMatchData = string.Empty; //LD[9], pudge[6] //string matchUrl = @"https://api.opendota.com/api/matches/3435926569"; //Silencer[9] //string matchUrl = @"https://api.opendota.com/api/matches/3431919866"; //LC[1], Silencer[8] string matchUrl = @"https://api.opendota.com/api/matches/3430165459"; //chat_test //string matchUrl = @"https://api.opendota.com/api/matches/3434156771"; //get match data request = new MyHttpRequest(matchUrl); jSonMatchData = request.makeRequest(); //process data Match match = JsonConvert.DeserializeObject <Match>(jSonMatchData); Console.ReadKey(); }
public static void Init() { MyHttpRequest request; string jSonData = string.Empty; string heroesUrl = @"https://api.steampowered.com/IEconDOTA2_570/GetHeroes/v0001/?key=94BF38B3239F45B17C42ABC130F9BDBD&language=en_gb"; //get hero data request = new MyHttpRequest(heroesUrl); jSonData = request.makeRequest(); heroes = JObject.Parse(jSonData).SelectToken("result.heroes").ToObject <Hero[]>(); }
public static void Init() { MyHttpRequest request; string jSonData = string.Empty; string itemsUrl = @"https://api.steampowered.com/IEconDOTA2_570/GetGameItems/V001/?key=94BF38B3239F45B17C42ABC130F9BDBD&language=en_gb"; //get item data request = new MyHttpRequest(itemsUrl); jSonData = request.makeRequest(); items = JObject.Parse(jSonData).SelectToken("result.items").ToObject <Item[]>(); }