Exemplo n.º 1
0
        public List <objMatch> getMatchOddNonLive(DateTime TimeLimit)
        {
            try
            {
                lst.Clear();
                string DataOddSboNonLive = http.Fetch(mainLink + "/web-root/restricted/odds-display/today-data.aspx?od-param=2,1,1,1,2,2,2,2,3,1&fi=1&v=0&dl=3", HttpHelper.HttpMethod.Get, null, null);
                string leagueDataNonLive = "[" + Util.GetSubstringByString(DataOddSboNonLive, "[[[", "]],[[") + "]";
                leagueDataNonLive = leagueDataNonLive.Replace("],[", "]\n[");
                string str_LeaugeSbo = "", str_TeamSbo = "";
                if (str_LeaugeSbo == "")
                {
                    hsLeagueNonLive.Clear();
                    foreach (string league in leagueDataNonLive.Split('\n'))
                    {
                        string leagueTemp     = league.Replace("[", "").Replace("]", "").Replace("'", "");
                        string nameleagueTemp = UtilSoccer.ChuanTenLeauge_Sbo(leagueTemp.Split(',')[1]).ToUpper();
                        if (nameleagueTemp.IndexOf("SPECIFIC") != -1 || nameleagueTemp.IndexOf("CORNERS") != -1 || nameleagueTemp.IndexOf("BOOKING") != -1 ||
                            nameleagueTemp.IndexOf("FANTASY MATCH") != -1 || nameleagueTemp.IndexOf("WHICH TEAM") != -1 || nameleagueTemp.IndexOf("TOTAL GOALS") != -1 ||
                            nameleagueTemp.IndexOf("INJURY") != -1 || nameleagueTemp.IndexOf("WINNER") != -1)
                        {
                            continue;
                        }
                        hsLeagueNonLive.Add(leagueTemp.Split(',')[0], nameleagueTemp);
                        if (str_LeaugeSbo.IndexOf(nameleagueTemp) == -1)
                        {
                            str_LeaugeSbo += nameleagueTemp + ",";
                        }
                    }
                }

                string matchDataNonLive = "[" + Util.GetSubstringByString(DataOddSboNonLive, "]],[[", "]],[[") + "]";
                matchDataNonLive = matchDataNonLive.Replace("],[", "]\n[");
                hsMatchNonLive.Clear();
                foreach (string matchNonLive in matchDataNonLive.Split('\n'))
                {
                    string   matchTempNonLive     = matchNonLive.Replace("[", "").Replace("]", "").Replace("'", "");
                    string[] arr_matchTempNonLive = matchTempNonLive.Split(',');
                    string   idmatchNonLive       = Util.GetSubstringByStringLast(DataOddSboNonLive, "[", "," + arr_matchTempNonLive[0]);
                    try
                    {
                        hsMatchNonLive.Add(idmatchNonLive, hsLeagueNonLive[arr_matchTempNonLive[2]].ToString() + "," + arr_matchTempNonLive[3] + "," + arr_matchTempNonLive[4] + "," + arr_matchTempNonLive[7]);
                    }
                    catch
                    {
                        continue;
                    }
                    if (str_TeamSbo.IndexOf(UtilSoccer.ChuanTenTeam_Sbo(arr_matchTempNonLive[3])) == -1 || str_TeamSbo.IndexOf(UtilSoccer.ChuanTenTeam_Sbo(arr_matchTempNonLive[4])) == -1)
                    {
                        str_TeamSbo += UtilSoccer.ChuanTenTeam_Sbo(arr_matchTempNonLive[3]) + "-" + UtilSoccer.ChuanTenTeam_Sbo(arr_matchTempNonLive[4]) + ",";
                    }
                }

                string oddDataNonLive = "[[" + Util.GetSubstringByString(DataOddSboNonLive, ",,[[", "]]],,") + "]]]";
                foreach (string OddTempNonLive in oddDataNonLive.Split(new string[] { "]],[" }, StringSplitOptions.None))
                {
                    objMatch o           = new objMatch();
                    string   OddTemp     = OddTempNonLive.Replace("[", "").Replace("]", "").Replace("'", "");
                    string[] arr_OddTemp = OddTemp.Split(',');
                    string   infomatch   = "";
                    try
                    {
                        infomatch = hsMatchNonLive[arr_OddTemp[1]].ToString();
                    }
                    catch
                    {
                        continue;
                    }
                    o.LeaugeName = UtilSoccer.ChuanTenLeauge_Sbo(infomatch.Split(',')[0]);
                    o.HomeName   = UtilSoccer.ChuanTenTeam_Sbo(infomatch.Split(',')[1]);
                    o.AwayName   = UtilSoccer.ChuanTenTeam_Sbo(infomatch.Split(',')[2]);
                    if (Matchs.Contains(o.HomeName + "-" + o.AwayName) == false)
                    {
                        Matchs += o.HomeName + "-" + o.AwayName + ",";
                    }
                    o.TimeNonLive = infomatch.Split(',')[3];
                    if (DateTime.Parse(o.TimeNonLive) > TimeLimit.AddHours(1))
                    {
                        continue;
                    }
                    if (o.TimeNonLive.Split('/').Length == 1)
                    {
                        o.TimeNonLive = o.TimeLive;
                    }

                    o.IdKeo   = arr_OddTemp[0];
                    o.hdp     = UtilSoccer.formatkeo(arr_OddTemp[5]);
                    o.BetType = arr_OddTemp[2];
                    o.Odd1    = arr_OddTemp[6];
                    o.Odd2    = arr_OddTemp[7];

                    lst.Add(o);
                }
            }
            catch (Exception)
            {
                lst.Clear();
                return(lst);
            }
            TotalMatch = "SBO MATCH: " + (Matchs.Split(',').Length - 1).ToString();
            return(lst);
        }
Exemplo n.º 2
0
        public List <objMatch> getMatchOddLive()
        {
            objMatch o;
            string   data = "";

            try
            {
                lstLive.Clear();
                data = http.Fetch(mainHost + "/UnderOver.aspx?Market=t&DispVer=new", HttpHelper.HttpMethod.Get, mainLink, null);
                if (data == "")
                {
                    o = new objMatch();
                    lstLive.Clear();
                    o.Score = "Logout";
                    lstLive.Add(o);
                    login();
                    return(lstLive);
                }
                int    ik    = data.IndexOf("name=\"k");
                int    iv    = data.IndexOf("value=\"v");
                string kIbet = data.Substring(ik + 6, iv - ik - 8);
                string vIbet = data.Substring(iv + 7, iv - ik - 8);
                string CT    = Util.EscapeDataString(DateTime.Now.AddHours(-11).ToString());
                data = http.Fetch(mainHost + "/UnderOver_data.aspx?Market=l&Sport=1&DT=&RT=W&CT=" + CT + "&Game=0&OrderBy=0&OddsType=4&MainLeague=0&DispRang=0&" + kIbet + "=" + vIbet + "&key=dodds&_=1502509515441", HttpHelper.HttpMethod.Get, mainHost + "/UnderOver.aspx?Market=t&DispVer=new", null);
                string LeaugeName = "", HomeName = "", AwayName = "", Time = "", Score = "";
                if (data == "")
                {
                    o = new objMatch();
                    lstLive.Clear();
                    o.Score = "Logout";
                    lstLive.Add(o);
                    login();
                    return(lstLive);
                }
                else
                {
                    foreach (Match m in Regex.Matches(data, @"Nl\[\d+\]=\[.*\];"))
                    {
                        string strIbetMatch = m.Value.ToString().Replace("];", "");
                        strIbetMatch = Regex.Replace(strIbetMatch, @"Nl\[\d+\]=\[", "");
                        strIbetMatch = strIbetMatch.Replace("'", "");

                        string[] dataIbetMatch = strIbetMatch.Split(',');
                        if (dataIbetMatch[5] != "")
                        {
                            LeaugeName = UtilSoccer.ChuanTenLeauge_Ibet(dataIbetMatch[5]);
                        }
                        if (LeaugeName.Contains("CORNERS") || LeaugeName.Contains("BOOKING") || LeaugeName.Contains("TEAM") || LeaugeName.Contains("WINNER") ||
                            LeaugeName.Contains("MATCH") || LeaugeName.Contains("SPECIFIC") || LeaugeName.Contains("SUBSTITUTION") ||
                            LeaugeName.Contains("GOAL KICK") || LeaugeName.Contains("OFFSIDE") || LeaugeName.Contains("THROW IN") ||
                            LeaugeName.Contains("FREE KICK") || LeaugeName.Contains("1st HALF vs 2nd HALF") || LeaugeName.Contains("RED CARD") ||
                            LeaugeName.Contains("OWN GOAL") || LeaugeName.Contains("PENALTY") || LeaugeName.Contains("TOTAL GOALS MINUTES") ||
                            LeaugeName.Contains("Injury"))
                        {
                            continue;
                        }

                        if (dataIbetMatch[6] != "")
                        {
                            HomeName = UtilSoccer.ChuanTenTeam_Ibet(dataIbetMatch[6]);
                            AwayName = UtilSoccer.ChuanTenTeam_Ibet(dataIbetMatch[7]);
                        }
                        if (dataIbetMatch[12] != "")
                        {
                            Time = dataIbetMatch[12].Replace("\\", "");
                        }
                        if (dataIbetMatch[21] != "" && dataIbetMatch[22] != "")
                        {
                            Score = dataIbetMatch[21] + "-" + dataIbetMatch[22];
                        }
                        ///FT///
                        try
                        {
                            o            = new objMatch();
                            o.Score      = Score;
                            o.TimeLive   = Time;
                            o.LeaugeName = LeaugeName;
                            o.HomeName   = HomeName;
                            o.AwayName   = AwayName;
                            if (Matchs.Contains(o.HomeName + "-" + o.AwayName) == false)
                            {
                                Matchs += o.HomeName + "-" + o.AwayName + ",";
                            }
                            o.IdKeo   = dataIbetMatch[31];
                            o.BetType = "1";
                            o.hdp     = dataIbetMatch[32];
                            o.Odd1    = dataIbetMatch[33];
                            o.Odd2    = dataIbetMatch[34];
                            if (dataIbetMatch[35] == "a")
                            {
                                o.hdp = "-" + o.hdp;
                            }
                            o.hdp = UtilSoccer.formatkeo(o.hdp);
                            lstLive.Add(o);
                        }
                        catch
                        { }



                        ///OUFT///
                        try
                        {
                            o            = new objMatch();
                            o.Score      = Score;
                            o.TimeLive   = Time;
                            o.LeaugeName = LeaugeName;
                            o.HomeName   = HomeName;
                            o.AwayName   = AwayName;
                            o.IdKeo      = dataIbetMatch[36];
                            o.BetType    = "3";
                            o.hdp        = dataIbetMatch[37];
                            o.Odd1       = dataIbetMatch[38];
                            o.Odd2       = dataIbetMatch[39];
                            if (dataIbetMatch[35] == "a")
                            {
                                o.hdp = "-" + o.hdp;
                            }
                            o.hdp = UtilSoccer.formatkeo(o.hdp);
                            lstLive.Add(o);
                        }
                        catch
                        { }

                        ///HT///
                        try
                        {
                            o            = new objMatch();
                            o.Score      = Score;
                            o.TimeLive   = Time;
                            o.LeaugeName = LeaugeName;
                            o.HomeName   = HomeName;
                            o.AwayName   = AwayName;
                            o.IdKeo      = dataIbetMatch[44];
                            o.BetType    = "7";
                            o.hdp        = dataIbetMatch[45];
                            o.Odd1       = dataIbetMatch[46];
                            o.Odd2       = dataIbetMatch[47];
                            if (dataIbetMatch[48] == "a")
                            {
                                o.hdp = "-" + o.hdp;
                            }
                            o.hdp = UtilSoccer.formatkeo(o.hdp);
                            lstLive.Add(o);
                        }
                        catch { }
                        ///HTOU///
                        try
                        {
                            o            = new objMatch();
                            o.Score      = Score;
                            o.TimeLive   = Time;
                            o.LeaugeName = LeaugeName;
                            o.HomeName   = HomeName;
                            o.AwayName   = AwayName;
                            o.IdKeo      = dataIbetMatch[49];
                            o.BetType    = "9";
                            o.hdp        = dataIbetMatch[50];
                            o.Odd1       = dataIbetMatch[51];
                            o.Odd2       = dataIbetMatch[52];
                            if (dataIbetMatch[48] == "a")
                            {
                                o.hdp = "-" + o.hdp;
                            }
                            o.hdp = UtilSoccer.formatkeo(o.hdp);
                            lstLive.Add(o);
                        }
                        catch { }
                    }
                }
            }
            catch (Exception)
            {
                o = new objMatch();
                lstLive.Clear();
                o.Score   = "Error";
                o.BetType = data;
                lstLive.Add(o);
                return(lstLive);
            }
            TotalMatch = "IBET MATCH: " + (Matchs.Split(',').Length - 1).ToString();
            return(lstLive);
        }