Exemplo n.º 1
0
        public virtual async Task <List <ThreadPost> > ExtractPostsAsync(string threadpagehtml, ForumUserCollection users)
        {
            var searchparser = new SearchPageParser(this.SearchInfo);
            var postparser   = new PostParser(this.PostInfo, searchparser, users);
            var result       = new List <ThreadPost>();

            var doc = new HtmlDocument();

            doc.LoadHtml(threadpagehtml);

            var posts = doc.DocumentNode.SelectNodes(this.ThreadInfo.XpathPosts);

            foreach (var post in posts)
            {
                result.Add(await postparser.ParseAsync(post.OuterHtml));
            }

            return(result);
        }
Exemplo n.º 2
0
 public PostParser(IPostInfo info, SearchPageParser userParser, ForumUserCollection users) : base()
 {
     this.Info         = info;
     this.Users        = users;
     this.SearchParser = userParser;
 }