/// <summary> /// Gets the first page of posts of the specified actuality. /// </summary> /// <param name="postActuality">The actuality of the posts that are to be retrieved.</param> /// <returns>Returns the first page of posts of the specified actuality.</returns> public Task<Page> GetPostsAsync(PostActuality postActuality) => this.GetPostsAsync(postActuality, new CancellationTokenSource().Token);
/// <summary> /// Gets the first page of posts of the specified actuality. /// </summary> /// <param name="postActuality">The actuality of the posts that are to be retrieved.</param> /// <param name="cancellationToken">The cancellation token, which can be used to cancel the retrieval of the posts.</param> /// <returns>Returns the first page of posts of the specified actuality.</returns> public Task<Page> GetPostsAsync(PostActuality postActuality, CancellationToken cancellationToken) { switch (postActuality) { case PostActuality.Hot: return this.GetPostsAsync(new Uri(NineGagClient.hotPath, UriKind.Relative), cancellationToken); case PostActuality.Trending: return this.GetPostsAsync(new Uri(NineGagClient.trendingPath, UriKind.Relative), cancellationToken); default: return this.GetPostsAsync(new Uri(NineGagClient.freshPath, UriKind.Relative), cancellationToken); } }