private string buildYouTubeIframe(YouTubeReasults term) { if (term.Type == "playlist") { return string.Format("<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/?list={0}\" frameborder=\"0\" allowfullscreen></iframe>", term.Id); } if (term.Type == "video") { return string.Format("<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/{0}\" frameborder=\"0\" allowfullscreen></iframe>", term.Id); } else { return default(string); } }
private Page BuildPostForYouTubeSearchTerm(YouTubeReasults termResult, TermPage term) { return new Page { Title = termResult.Title + " " + term.Term, Content = buildYouTubeIframe(termResult) + "<br>" + termResult.Description + "<br>" + SnipetReader.GetArtical(term.Term), }; }