public async Task <Post> LoadPostAsync(int postId)
        {
            var pageHtml = await _booruLoader.LoadPageAsync(SANKAKU_POST_URL + postId);

            var htmlDoc = new HtmlDocument();

            htmlDoc.LoadHtml(pageHtml);

            var post = new SankakuPost(postId, htmlDoc.DocumentNode);

            return(post);
        }
Exemple #2
0
        public async Task <Post> LoadPostAsync(int postId)
        {
            var postHtml = await _booruLoader.LoadPageAsync(POST_URL + postId);

            var postJson = JsonConvert.DeserializeObject <List <Model.Yandere.Json.Post> >(await _booruLoader.LoadPageAsync(POST_JSON + postId)).FirstOrDefault();

            var htmlDoc = new HtmlDocument();

            htmlDoc.LoadHtml(postHtml);

            var post = new YanderePost(postId, htmlDoc.DocumentNode, postJson);

            return(post);
        }
Exemple #3
0
        public async Task <Post> LoadPostAsync(int postId)
        {
            var postHtml = await _booruLoader.LoadPageAsync(POST_URL + postId).ConfigureAwait(false);

            var postJsonString = await _booruLoader.LoadPageAsync(string.Format(POST_JSON, postId)).ConfigureAwait(false);

            var postJson = JsonConvert.DeserializeObject <Model.Danbooru.Json.Post>(postJsonString);

            var htmlDoc = new HtmlDocument();

            htmlDoc.LoadHtml(postHtml);

            var post = new DanbooruPost(postId, htmlDoc.DocumentNode, postJson);

            if (post.IsUgoira)
            {
                await LoadUgoiraMeta(post);
            }

            return(post);
        }