Example #1
0
 public static List<ChapterItem> GetBook(ref BookItem item, WebRuleItem rule)
 {
     var html = new HtmlExpand();
     html.SetUrl(item.Url);
     if (!string.IsNullOrWhiteSpace(rule.CoverBegin) || !string.IsNullOrWhiteSpace(rule.CoverEnd))
     {
         item.Image = html.GetCover(rule.CoverBegin, rule.CoverEnd);
     }
     if (!string.IsNullOrWhiteSpace(rule.AuthorBegin) || !string.IsNullOrWhiteSpace(rule.AuthorEnd))
     {
         item.Author = html.GetAuthor(rule.AuthorBegin, rule.AuthorEnd);
     }
     if (!string.IsNullOrWhiteSpace(rule.DescriptionBegin) || !string.IsNullOrWhiteSpace(rule.DescriptionEnd))
     {
         item.Description = html.GetDescription(rule.DescriptionBegin, rule.DescriptionEnd);
     }
     var chapters = GetChapters(item, rule, html);
     item.Count = chapters.Count;
     return chapters;
 }
Example #2
0
        public static List <ChapterItem> GetBook(ref BookItem item, WebRuleItem rule)
        {
            var html = new HtmlExpand();

            html.SetUrl(item.Url);
            if (!string.IsNullOrWhiteSpace(rule.CoverBegin) || !string.IsNullOrWhiteSpace(rule.CoverEnd))
            {
                item.Image = html.GetCover(rule.CoverBegin, rule.CoverEnd);
            }
            if (!string.IsNullOrWhiteSpace(rule.AuthorBegin) || !string.IsNullOrWhiteSpace(rule.AuthorEnd))
            {
                item.Author = html.GetAuthor(rule.AuthorBegin, rule.AuthorEnd);
            }
            if (!string.IsNullOrWhiteSpace(rule.DescriptionBegin) || !string.IsNullOrWhiteSpace(rule.DescriptionEnd))
            {
                item.Description = html.GetDescription(rule.DescriptionBegin, rule.DescriptionEnd);
            }
            var chapters = GetChapters(item, rule, html);

            item.Count = chapters.Count;
            return(chapters);
        }