Exemplo n.º 1
0
        private static ConferenceTalk ExtractTalk(HtmlNode talkNode, string talkUrl)
        {
            var talkTitle    = String.Empty;
            var talkSpeaker  = String.Empty;
            var talkPropList = talkNode.Descendants("div").ToList();

            if (talkPropList != null && talkPropList.Count == 3)
            {
                var titleDiv = talkPropList[1];
                if (titleDiv != null)
                {
                    talkTitle = titleDiv.InnerText;
                }
                var speakerDiv = talkPropList[2];
                if (speakerDiv != null)
                {
                    talkSpeaker = speakerDiv.InnerText;
                }
            }
            //at this point, all properties should be populated
            var talk = new ConferenceTalk
            {
                Speaker = talkSpeaker,
                Title   = talkTitle,
                Url     = talkUrl
            };

            return(talk);
        }
Exemplo n.º 2
0
 private static void ExtractTalkDetails(string htmlContent, ConferenceTalk talk)
 {
     if (!String.IsNullOrWhiteSpace(htmlContent))
     {
         var doc = new HtmlDocument();
         doc.LoadHtml(htmlContent);
         talk.Summary  = ExtractKicker(doc);
         talk.VideoUrl = ExtractVideoUrl(doc);
     }
 }