Ejemplo n.º 1
0
        private static void SetupSites()
        {
            var manager = new SitesManager();

            #region Intertops - Next Games
            var IntertopsNG = new Site()
            {
                Url          = "https://sports.intertops.eu/en/Bets/Sport/12",
                Name         = "Intertops - Next Games",
                Image        = "",
                ScrapingInfo = new ScrapingInfo()
                {
                    GameListExpression     = "//ul[contains(@class,'nextbets')]/li[not(@class)]",
                    DateExpression         = ".//div/div[contains(@class, 'event-date')]/span",
                    DateAttribute          = "title",
                    DateFormat             = "M/d/yyyy'<br/>'h:mm tt",
                    TimeExpression         = ".//div/div[contains(@class, 'event-date')]/span",
                    TimeAttribute          = "title",
                    TimeFormat             = "M/d/yyyy'<br/>'h:mm tt",
                    HomeTeamNameExpression = ".//div/div[contains(@class,'market-options')]/div/div[1]/div",
                    HomeTeamAttribute      = "title",
                    AwayTeamNameExpression = ".//div/div[contains(@class,'market-options')]/div/div[3]/div",
                    AwayTeamAttribute      = "title",
                    HomeRatioExpression    = ".//div/div[contains(@class,'market-options')]/div/div[1]/div/a/span[2]",
                    HomeRatioAttribute     = "",
                    RatioXExpression       = ".//div/div[contains(@class,'market-options')]/div/div[2]/div/a/span[2]",
                    RatioXAttribute        = "",
                    AwayRatioExpression    = ".//div/div[contains(@class,'market-options')]/div/div[3]/div/a/span[2]",
                    AwayRatioAttribute     = "",
                }
            };
            #endregion
            manager.Add(IntertopsNG);

            #region Intertops - Top Bets
            var IntertopsTB = new Site()
            {
                Url          = "https://sports.intertops.eu/en/Bets/Sport/12",
                Name         = "Intertops - Top Bets",
                Image        = "",
                ScrapingInfo = new ScrapingInfo()
                {
                    GameListExpression     = "//ul[contains(@class,'topbets')]/li",
                    DateExpression         = ".//div/div[contains(@class, 'event-date')]/span",
                    DateAttribute          = "title",
                    DateFormat             = "M/d/yyyy'<br/>'h:mm tt",
                    TimeExpression         = ".//div/div[contains(@class, 'event-date')]/span",
                    TimeAttribute          = "title",
                    TimeFormat             = "M/d/yyyy'<br/>'h:mm tt",
                    HomeTeamNameExpression = ".//div/div[contains(@class,'market-options')]/div/div[1]/div",
                    HomeTeamAttribute      = "title",
                    AwayTeamNameExpression = ".//div/div[contains(@class,'market-options')]/div/div[3]/div",
                    AwayTeamAttribute      = "title",
                    HomeRatioExpression    = ".//div/div[contains(@class,'market-options')]/div/div[1]/div/a/span[2]",
                    HomeRatioAttribute     = "",
                    RatioXExpression       = ".//div/div[contains(@class,'market-options')]/div/div[2]/div/a/span[2]",
                    RatioXAttribute        = "",
                    AwayRatioExpression    = ".//div/div[contains(@class,'market-options')]/div/div[3]/div/a/span[2]",
                    AwayRatioAttribute     = "",
                }
            };
            #endregion
            //manager.Add(IntertopsTB);

            #region WilliamHill
            var WilliamHill = new Site()
            {
                Url          = "http://sports.williamhill.com/bet/en-gb/betting/y/5/Football.html",
                Name         = "WilliamHill",
                Image        = "",
                ScrapingInfo = new ScrapingInfo()
                {
                    GameListExpression     = "//tr[contains(@class,'rowOdd') and not(td[1]/a)]",
                    DateExpression         = ".//td[1]/span",
                    DateAttribute          = "",
                    DateFormat             = "dd MMM",
                    TimeExpression         = ".//td[2]/span",
                    TimeAttribute          = "",
                    TimeFormat             = "HH:mm 'UK'",
                    HomeTeamNameExpression = ".//td[3]/a/span",
                    HomeTeamAttribute      = "",
                    AwayTeamNameExpression = ".//td[3]/a/span",
                    AwayTeamAttribute      = "",
                    HomeRatioExpression    = ".//td[5]/div/div",
                    HomeRatioAttribute     = "",
                    RatioXExpression       = ".//td[6]/div/div",
                    RatioXAttribute        = "",
                    AwayRatioExpression    = ".//td[7]/div/div",
                    AwayRatioAttribute     = "",
                }
            };
            #endregion
            manager.Add(WilliamHill);

            #region BWin
            var BWin = new Site()
            {
                Url          = "https://sports.bwin.com/en/sports#sportId=4",
                Name         = "BWin",
                Image        = "",
                ScrapingInfo = new ScrapingInfo()
                {
                    GameListExpression     = "//div[@id='markets']/div[1]/div/div/div/div/div/div[contains(@class,'marketboard-event-group__item--sub-group')]/div/div[contains(@class,'marketboard-event-group__item--event')]",
                    DateExpression         = "//div[@id='markets']/div[1]/div/div/h2/span",
                    DateAttribute          = "",
                    DateFormat             = "dddd - M/d/yyyy",
                    TimeExpression         = ".//div/div/div[1]",
                    TimeAttribute          = "",
                    TimeFormat             = "h:mm tt",
                    HomeTeamNameExpression = ".//div/div/div[3]/table/tbody/tr/td[1]/form/button/div[1]",
                    HomeTeamAttribute      = "",
                    AwayTeamNameExpression = ".//div/div/div[3]/table/tbody/tr/td[5]/form/button/div[1]",
                    AwayTeamAttribute      = "",
                    HomeRatioExpression    = ".//div/div/div[3]/table/tbody/tr/td[1]/form/button/div[2]",
                    HomeRatioAttribute     = "",
                    RatioXExpression       = ".//div/div/div[3]/table/tbody/tr/td[3]/form/button/div[2]",
                    RatioXAttribute        = "",
                    AwayRatioExpression    = ".//div/div/div[3]/table/tbody/tr/td[5]/form/button/div[2]",
                    AwayRatioAttribute     = ""
                }
            };
            #endregion
            manager.Add(BWin);

            #region MockSite1
            var MockSite = new Site()
            {
                Url          = "http://lior-kedem.com/dor_test/MockSite1.html",
                Name         = "Intertops - Next Games",
                Image        = "",
                ScrapingInfo = new ScrapingInfo()
                {
                    GameListExpression     = "//ul/li",
                    DateExpression         = ".//div[1]",
                    DateAttribute          = "",
                    DateFormat             = "dd/MM/yy HH:mm",
                    TimeExpression         = ".//div[1]",
                    TimeAttribute          = "",
                    TimeFormat             = "dd/MM/yy HH:mm",
                    HomeTeamNameExpression = ".//div[2]/span[1]",
                    HomeTeamAttribute      = "",
                    AwayTeamNameExpression = ".//div[4]/span[1]",
                    AwayTeamAttribute      = "",
                    HomeRatioExpression    = ".//div[2]/span[2]",
                    HomeRatioAttribute     = "",
                    RatioXExpression       = ".//div[3]/span[2]",
                    RatioXAttribute        = "",
                    AwayRatioExpression    = ".//div[4]/span[2]",
                    AwayRatioAttribute     = "",
                }
            };
            #endregion
            manager.Add(MockSite);
        }