示例#1
0
        public Situation_W Parse(Schedule schedule, String html)
        {
            HtmlDocument doc = new HtmlDocument();
            doc.LoadHtml(html);
            var element = doc.DocumentNode.SelectSingleNode("//*[@class=\"situation\"]");

            Situation_W situation_W = new Situation_W();
            situation_W.GameId = schedule.GameId;
            situation_W.Content = element.OuterHtml;
            return situation_W;
        }
示例#2
0
        public Match MakeMatch(Situation_W situation, BoxScore_W boxScore)
        {
            // MatchInfo 만들기
            var matchInfo = MakeMatchInfo(boxScore);

            // Make Match
            Match match = new Match();
            match.GameId = situation.GameId;

            // MakeThs
            match.Ths = MakeThs(match, situation, matchInfo);

            return match;
        }
示例#3
0
        private List<Th> MakeThs(Match match, Situation_W situation, MatchInfo matchInfo)
        {
            String[] separator = new String[] { "회" };
            List<Th> ths = new List<Th>();

            HtmlDocument doc = new HtmlDocument();
            doc.LoadHtml(situation.Content);

            for (Int32 i = 1; i <= 12; ++i)
            {
                String id = String.Format("sms{0:D2}", i);
                var allNode = doc.DocumentNode.SelectSingleNode(String.Format("//*[@id='{0}']", id));

                if (allNode != null)
                {
                    var th = MakeTh(match, allNode.OuterHtml, i, matchInfo);
                    if (th != null)
                    {
                        ths.Add(th);
                    }
                }
            }
            return ths;
        }