Ejemplo n.º 1
0
        public JObject GetChampionDetail(string auth, string champion_id)
        {
            string referer = @"http://game.tgp.qq.com/lol/champions/v1605/info.shtml?champion_id=#champion_id#"
                             .Replace("#champion_id#", champion_id);
            string url = "http://cdn.tgp.qq.com/pallas/conf/heros/#champion_id#.js?t=#t#&_=#t#"
                         .Replace("#t#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString())
                         .Replace("#champion_id#", champion_id);;
            string host        = "cdn.tgp.qq.com";
            string jsonrawdata = APILib.GetJSONRawData(host, referer, url, auth);

            string  reg     = @"data:\s*({[\S\s]*),updated:";
            string  result  = CommonLib.TextHelper.MatchContent(reg, jsonrawdata, RegexOptions.Multiline, 1);
            JObject jobject = JObject.Parse(result);
            JObject json    = APILib.Iced(jobject);

            return(json);
        }
Ejemplo n.º 2
0
        public JObject Free(string auth)
        {
            try
            {
                string referer = @"http://game.tgp.qq.com/lol/champions/v1605/lib.shtml";
                string url     = @"http://lol.qq.com/biz/hero/free.js?t=#t#&_=#t#"
                                 .Replace("#t#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString());
                string host = "lol.qq.com";

                string jsonrawdata = APILib.GetJSONRawData(host, referer, url, auth);

                string  reg     = @"""data"":\s*({.*}),(\r\n)*\s*""";
                string  result  = CommonLib.TextHelper.MatchContent(reg, jsonrawdata, RegexOptions.Multiline, 1);
                JObject jobject = JObject.Parse(result);
                JObject json    = APILib.Iced(jobject);
                return(json);
            }
            catch (Exception ex)
            {
                LogHelper.LogError("Free", ex);
                return(APILib.Error(ex.Message));
            }
        }
Ejemplo n.º 3
0
        public JObject ChampionRank(string auth, string championid, int p)
        {
            try
            {
                string referer = @"http://game.tgp.qq.com/lol/champions/v1605/rank.shtml";
                string url     = @"http://img.lol.qq.com/js/cevRank/#championid#/#p#.js?t=#t#"
                                 .Replace("#championid#", championid)
                                 .Replace("#p#", p.ToString())
                                 .Replace("#t#", DateHelper.ConvertDateTime2Long13(DateTime.Now).ToString());

                string  host        = "img.lol.qq.com";
                string  jsonrawdata = APILib.GetJSONRawData(host, referer, url, auth);
                string  reg         = @"""data"":\s*({.*}),(\r\n)*\s*""";
                string  result      = CommonLib.TextHelper.MatchContent(reg, jsonrawdata, RegexOptions.Multiline, 1);
                JObject jobject     = JObject.Parse(result);
                JObject json        = APILib.Iced(jobject);
                return(json);
            }
            catch (Exception ex)
            {
                LogHelper.LogError("ChampionRank", ex);
                return(APILib.Error(ex.Message));
            }
        }