private static string ExtractStoryBody(String html) { if (String.IsNullOrEmpty(html)) { return(string.Empty); } // Extract the body with markup var rgxBody = new Regex("<div class=\"yom-mod yom-art-content {ctx.media.modules.article.article_body.fontsize}\">(?<Body>.+?)</div>", RegexOptions.Singleline); Match m = rgxBody.Match(html); if (m.Success) { String xmlText = m.Groups["Body"].Value; // Strip out any markup and other crap string plain = Regex.Replace(xmlText, "<.+?>|\n|\t", "", RegexOptions.Singleline); plain = RssTextHelper.ReplaceSpecialChars(plain); return(plain); } return("Unable to parse HTML"); }
public void BeginRefresh() { string htmlText = RssTextHelper.ExtractHtmlText(new Uri(link)); this.Text = ExtractStoryBody(htmlText); }