예제 #1
0
        /// <summary>
        /// Sending request for one player above and one behind specified player
        /// </summary>
        /// <param name="leagueName"></param>
        /// <param name="offset"></param>
        /// <returns></returns>

        public static PlayerDataRootObject GetDataOfPlayerAboveAndBehind(string leagueName, int offset)
        {
            string url    = $"http://api.pathofexile.com/ladders/{leagueName}?offset={offset}&limit=3";
            var    client = new WebClient();
            var    json   = client.DownloadString(url);
            PlayerDataRootObject result = JsonConvert.DeserializeObject <PlayerDataRootObject>(json);

            return(result);
        }
예제 #2
0
        /// <summary>
        /// Sending request to API with params
        /// </summary>
        /// <param name="IGN">
        /// Player IGN
        /// </param>
        /// <param name="leagueName">
        /// Player leagueName
        /// </param>
        /// <returns>
        /// Deserialized object with player data
        /// </returns>

        public static PlayerDataRootObject GetPlayerData(string IGN, string leagueName)
        {
            string url    = $"http://api.pathofexile.com/ladders/{leagueName}?limit=1&accountName={IGN}";
            var    client = new WebClient();
            var    json   = client.DownloadString(url);
            PlayerDataRootObject result = JsonConvert.DeserializeObject <PlayerDataRootObject>(json);

            return(result);
        }