Exemplo n.º 1
0
        public List <PossibleBet> GetBets(string link)
        {
            var source = new WebSourceFetcher().GetPageSource("http://skybet.com" + link);

            var list = new List <PossibleBet>();

            var index = source.IndexOf("data-event-headline") + 14;

            source = source.Substring(index);
            index  = source.IndexOf(">") + 1;
            source = source.Substring(index);
            index  = source.IndexOf("</");
            var title = source.Substring(0, index);

            source = source.Substring(index);

            index  = source.IndexOf("<h2");
            source = source.Substring(index);

            index  = source.IndexOf(">");
            source = source.Substring(index);
            index  = source.IndexOf("|") + 1;
            source = source.Substring(index);
            index  = source.IndexOf("<");
            var date = source.Substring(0, index);

            var split    = date.Split('|');
            var fullDate = split[0].Trim() + " @ " + split[1].Trim();

            return(list);
        }
Exemplo n.º 2
0
        public List <Fixture> GetFixtures(string league)
        {
            // get page source
            var source = new WebSourceFetcher().GetPageSource($"http://www.skysports.com/football/competitions/{league}/fixtures");
            var list   = new List <Fixture>();

            if (String.IsNullOrEmpty(source))
            {
                return(list);
            }

            list = ExtractFixtures(source, league);

            return(list);
        }
Exemplo n.º 3
0
        public List <string> LoadLinks(string league)
        {
            List <string> list = new List <string>();

            var source = new WebSourceFetcher().GetPageSource($"https://m.skybet.com/football/coupon/10010808");

            var matchIndex = source.IndexOf($"/football/{league}/event/");
            int count      = 0;

            while (matchIndex > -1)
            {
                source = source.Substring(matchIndex);
                var linkEnd = source.IndexOf("\"");
                var link    = source.Substring(0, linkEnd);

                //var src = new WebSourceFetcher().GetPageSource("http://skybet.com" + link);

                //var titleStart = source.IndexOf("cell-text__line cell-text__line--icon") + 30;
                //source = source.Substring(titleStart);
                //titleStart = source.IndexOf(">") + 1;
                //source = source.Substring(titleStart);
                //titleStart = source.IndexOf("</");
                //var title = source.Substring(0, titleStart);
                //source = source.Substring(titleStart);

                //var split = title.Split(new string[] { " v " }, StringSplitOptions.None);

                //var homeTeam = split[0]; // run through alias calculator
                //var awayTeam = split[1]; // run through alias calculator

                list.Add(link);

                source = source.Substring(20);

                // next one
                matchIndex = source.IndexOf($"/football/{league}/event/");
                count++;
            }

            return(list);
        }