Beispiel #1
0
        /// <summary>
        /// get follower for the first blog
        /// </summary>
        /// <returns>a string</returns>
        public async Task <string> GetFollowerCount()
        {
            UserInfo user = await _tc.GetUserInfoAsync();

            Followers followers = await _tc.GetFollowersAsync(user.Blogs.First().Name);

            string result = $"Your blog {user.Blogs.First().Name} have {followers.Count} Follower";

            return(result);
        }
Beispiel #2
0
        public async Task <string> GetBlog(string blogName)
        {
            Followers followers = await _tc.GetFollowersAsync(blogName);

            BlogInfo blogInfo = await _tc.GetBlogInfoAsync(blogName);

            StringBuilder sb = new StringBuilder();

            AddHtmlHeader(sb, "Blog");

            sb.AppendLine($"Your blog {blogName} with Title: {blogInfo.Title} have:");
            sb.AppendLine($"<p>{followers.Count} Follower</p>");
            sb.AppendLine($"<p>{blogInfo.PostsCount} Posts</p>");
            sb.AppendLine($"<p>{blogInfo.LikesCount} Likes</p>");

            AddEndHTML(sb);

            string result = sb.ToString();

            return(result);
        }