Example #1
0
 private static void getEachURLTitle(string sourceCode)
 {
     for (int i = 0; i != -1; i = sourceCode.IndexOf("selchamp"))
     {
         int startIndex = sourceCode.IndexOf("selchamp") + 50;
         sourceCode = sourceCode.Substring(startIndex, sourceCode.Length - startIndex);
         int urlStartIndex = sourceCode.IndexOf("index.php");
         sourceCode = sourceCode.Substring(urlStartIndex, sourceCode.Length - urlStartIndex);
         int      nameEndIndex   = sourceCode.IndexOf("</a>");
         string   eachURLTitle   = sourceCode.Substring(0, nameEndIndex);
         int      nameStartIndex = eachURLTitle.IndexOf(">");
         string   url            = "https://olimp.kz/betting/" + eachURLTitle.Substring(0, nameStartIndex - 1);
         string   tourTitle      = eachURLTitle.Substring(nameStartIndex + 1, eachURLTitle.Length - nameStartIndex - 1);
         string[] title          = new string[7];
         title = ClassParseTitle.getATP(ClassParseTitle.parseTitle(tourTitle));
         if (title[0] == "ATP" && title[3] == "Null")
         {
             parseATPSinge(url, title);
         }
     }
 }
        public static void getEachTour(string date, string sourceCode)
        {
            int index = 0;

            while (index != -1)
            {
                string eachTour;
                int    startIndex = sourceCode.IndexOf("smwndcap") + 44;
                sourceCode = sourceCode.Substring(startIndex, sourceCode.Length - startIndex);
                int endIndex = sourceCode.IndexOf("</td></tr></table>");
                eachTour = sourceCode.Substring(0, endIndex);
                string tourTitle = eachTour.Substring(0, eachTour.IndexOf("koeftable") - 60);

                string[] title = new string[7];
                title = ClassParseTitle.getATP(ClassParseTitle.parseTitle(tourTitle));

                if (title[0] == "ATP" && title[3] == "Null")
                {
                    parseATPSingle(date, title, eachTour);
                }
                index = sourceCode.IndexOf("smwndcap");
            }
        }