Example #1
0
        //Get match time from matchbox node and returns in Day + 24 hour time
        private string GetMatchTime(HtmlNode match)
        {
            HtmlNode timeElem = match.SelectSingleNode(".//div[@data-time-format]");

            if (timeElem != null)
            {
                long           unixTime = long.Parse(timeElem.GetAttributeValue("data-unix", "-1"));
                DateTimeOffset matchDateTime = DateTimeOffset.FromUnixTimeMilliseconds(unixTime).ToLocalTime();
                int            hour = matchDateTime.TimeOfDay.Hours, min = matchDateTime.TimeOfDay.Minutes;
                string         time = " @ " + matchDateTime.DayOfWeek + " " + Etc.ConvertToStringTime(hour, min);
                return(time);
            }
            else
            {
                List <string> classes = match.GetClasses().ToList();
                if (classes.Contains("matchover"))
                {
                    return("match ended");
                }
            }
            return(" @ Unknown time");
        }