Ejemplo n.º 1
0
        public void CrawlGolfBettingMarketName()
        {
            string url         = "";
            string htmlcontent = Helper.GetWebSiteContent(url);

            HtmlAgilityPack.HtmlDocument doc = Helper.LoadHtml(htmlcontent);
            XmlDocument         xmldoc       = new XmlDocument();
            CrawlAllMarketsData crawldata    = new CrawlAllMarketsData();
            var row11 = doc.DocumentNode.SelectSingleNode("//ul[@class='more-outrights 1']");
            var rows  = row11.SelectNodes("./a");

            if (rows != null)
            {
                List <MarketMaster> lit = new List <MarketMaster>();
                for (int i = 0; i < rows.Count; i++)
                {
                    MarketMaster market  = new MarketMaster();
                    string       li      = rows[i].InnerText;
                    var          linkrow = rows[i].SelectNodes("./span");
                    market.MarketMarketName = linkrow[0].InnerText;
                    market.MarketResultLink = "http://www.oddschecker.com" + rows[0].Attributes["href"].Value;
                    market.MarketSportID    = 29;
                    InsertMasterMarket(market);
                    lit.Add(market);
                }
                xmldoc = GenerateXmlGolfMarketMaster(lit);
            }
        }
Ejemplo n.º 2
0
        public void CrawlMarketLinks(long matchid)
        {
            CrawlAllMarketsData crawl = new CrawlAllMarketsData();
            DataTable           dt    = crawl.GetBettingMarkets(matchid);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string link = dt.Rows[i]["bettinglink"].ToString();
                CrawlMarkets(link);
            }
        }
Ejemplo n.º 3
0
        public void CrawlMarketLinks()
        {
            CrawlAllMarketsData crawl     = new CrawlAllMarketsData();
            CrawlEachMarketData crawldata = new CrawlEachMarketData();
            DataTable           dt        = crawl.GetBettingMarkets();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                XmlDocument   xmldoc          = new XmlDocument();
                string        link            = dt.Rows[i]["bettinglink"].ToString();
                long          bettingmarketid = Convert.ToInt32(dt.Rows[i]["id"].ToString());
                long          matchid         = Convert.ToInt32(dt.Rows[i]["matchid"].ToString());
                List <Market> market          = CrawlMarkets(link); //, id, matchid);
                xmldoc = GenerateXml(market);
                crawldata.InsertEachMarket(xmldoc, bettingmarketid, matchid);
            }
        }
Ejemplo n.º 4
0
        public void CrawlBettingMarkets(object tp)
        {
            ThreadParameters t   = tp as ThreadParameters;
            string           url = t.URL;
            int matchid          = t.MatchID;

            try
            {
                TraceService("Crawling Betting Market, MatchID:" + matchid + " and URL: " + url + " ----");
                string htmlcontent = Helper.GetWebSiteContent(url);
                HtmlAgilityPack.HtmlDocument doc         = Helper.LoadHtml(htmlcontent);
                List <BettingMarket>         bettinglist = new List <BettingMarket>();
                XmlDocument         xmldoc    = new XmlDocument();
                CrawlAllMarketsData crawldata = new CrawlAllMarketsData();
                var row11 = doc.DocumentNode.SelectSingleNode("//div[@id='mc']");
                var rows  = row11.SelectNodes("//ul//li[@class='more-list-li']");
                if (rows != null)
                {
                    for (int i = 0; i < rows.Count; i++)
                    {
                        string li      = rows[i].InnerText;
                        var    linkrow = rows[i].SelectNodes("./a");
                        string link    = "http://www.oddschecker.com" + linkrow[0].Attributes["href"].Value;
                        //links+=li+" "+link+" ";
                        if (!bettinglist.Exists(bettingmarket => bettingmarket.bettingmarket == li))
                        {
                            bettinglist.Add(new BettingMarket()
                            {
                                matchid = matchid, bettingmarket = li, bettinglink = link
                            });
                        }
                    }
                }

                xmldoc = GenerateXml(bettinglist);
                crawldata.InsertMarkets(xmldoc);
                TraceService("Betting Market Data Inserted MatchID:" + matchid + " and URL:" + url + "------");
            }
            catch (Exception ex)
            {
                ErrorLog("CrawlBettingMarket______MatchID: " + matchid + " and URL:" + url + " Error:" + ex.ToString());
            }
        }
Ejemplo n.º 5
0
        public static string GetMarketName(long marketid)
        {
            CrawlAllMarketsData crawldata = new CrawlAllMarketsData();

            return(crawldata.GetMarketName(marketid));
        }
Ejemplo n.º 6
0
        public DataSet GetMatchByDate(int sportid)
        {
            CrawlAllMarketsData crawldata = new CrawlAllMarketsData();

            return(crawldata.GetMatchByDate(sportid));
        }
Ejemplo n.º 7
0
        public DataTable GetMatchResult(int matchid, int sportid)
        {
            CrawlAllMarketsData crawldata = new CrawlAllMarketsData();

            return(crawldata.GetMatchResult(matchid, sportid));
        }
Ejemplo n.º 8
0
        public string[] GetChampionMatchInfo(int matchid)
        {
            CrawlAllMarketsData crawldata = new CrawlAllMarketsData();

            return(crawldata.GetMatchinfobyid(matchid));
        }
Ejemplo n.º 9
0
        public DataTable GetMatchesByCoupon()
        {
            CrawlAllMarketsData crawldata = new CrawlAllMarketsData();

            return(crawldata.GetMatchesByCoupon());
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Added my dev nagar
        /// for Info of Matches by League id
        /// </summary>
        /// <param name="leagueid"></param>
        /// <returns>datatable</returns>
        public DataTable GetMatchesByLeague(int leagueid)
        {
            CrawlAllMarketsData crawldata = new CrawlAllMarketsData();

            return(crawldata.GetMatches(leagueid));
        }
Ejemplo n.º 11
0
        public DataSet GetMatchesAndMarketsFoSoccer()
        {
            CrawlAllMarketsData crawldata = new CrawlAllMarketsData();

            return(crawldata.GetMatchesAndMarketsForSoccer());
        }
Ejemplo n.º 12
0
        public DataTable GetBettingMarkets(long matchid)
        {
            CrawlAllMarketsData crawldata = new CrawlAllMarketsData();

            return(crawldata.GetBettingMarkets(matchid));
        }
Ejemplo n.º 13
0
        public DataTable GetMasterMarketName(int sportid)
        {
            CrawlAllMarketsData crawldata = new CrawlAllMarketsData();

            return(crawldata.GetMasterMarketName(sportid));
        }