/// <summary> /// Gets a paged list of popular posts /// </summary> /// <param name="options">paging options</param> /// <returns>Standard Paged Response of VinePosts</returns> public async Task <VineTimelineResponse> PopularTimeline(VinePagingOptions options = null) { var request = GetBaseRequest(VineEndpoints.TimelinesPopular); AddPagingOptions(request, options); return(await GetResult <VineTimelineResponse>(request)); }
/// <summary> /// Gets a paged list of posts for a specified user's timeline /// </summary> /// <param name="userId">User Id</param> /// <param name="options">paging options</param> /// <returns>Standard Paged Response of VinePosts</returns> public async Task <VineTimelineResponse> UserTimeline(long userId, VinePagingOptions options = null) { var request = GetBaseUserRequest(VineEndpoints.TimelineUser, userId.ToString(CultureInfo.InvariantCulture)); AddPagingOptions(request, options); return(await GetResult <VineTimelineResponse>(request)); }
/// <summary> /// Gets a paged list of posts with a given hashtag /// </summary> /// <param name="tag">Hashtag with the # removed (i.e. "#test" should be "test") </param> /// <param name="options">paging options</param> /// <returns>Standard Paged Response of VinePosts</returns> public async Task <VineTimelineResponse> TagTimeline(string tag, VinePagingOptions options = null) { var request = GetBaseRequest(VineEndpoints.TimelineTag); request.AddUrlSegment("tag", tag); AddPagingOptions(request, options); return(await GetResult <VineTimelineResponse>(request)); }
/// <summary> /// Gets a paged list of comments for a given post /// </summary> /// <param name="postId">Post Id</param> /// <param name="options">paging options</param> /// <returns>Standard Paged Response of VineComments</returns> public async Task <VineCommentsResponse> Comments(long postId, VinePagingOptions options = null) { var request = GetBaseRequest(VineEndpoints.PostComments); request.AddUrlSegment("postId", postId.ToString(CultureInfo.InvariantCulture)); AddPagingOptions(request, options); return(await GetResult <VineCommentsResponse>(request)); }
private static void AddPagingOptions(RestRequest request, VinePagingOptions options) { if (options == null) { return; } if (options.Size != default(int)) { request.AddQueryString("size", options.Size); } if (options.Page != default(int)) { request.AddQueryString("size", options.Page); } if (options.Anchor != default(long)) { request.AddQueryString("anchor", options.Anchor); } }
private static RestRequest GetBasePostRequest(string endpoint, string postId, VinePagingOptions options = null) { var request = GetBaseRequest(endpoint); request.AddUrlSegment("postId", postId); AddPagingOptions(request, options); return(request); }
/// <summary> /// Gets a paged list of likes for a given post /// </summary> /// <param name="postId">Post Id</param> /// <param name="options">paging options</param> /// <returns>Standard Paged Response of VineLikes</returns> public async Task <VineLikesResponse> Likes(long postId, VinePagingOptions options = null) { var request = GetBasePostRequest(VineEndpoints.PostLikes, postId.ToString(CultureInfo.InvariantCulture), options); return(await GetResult <VineLikesResponse>(request)); }
/// <summary> /// Gets a paged list of people the specified user is following /// </summary> /// <param name="userId">User Id</param> /// <param name="options">paging options</param> /// <returns>Standard Paged Response of VineFollowers (similar to a VineProfile)</returns> public async Task <VineFollowersResponse> UserFollowing(long userId, VinePagingOptions options = null) { var request = GetBaseUserRequest(VineEndpoints.UserFollowing, userId.ToString(CultureInfo.InvariantCulture), options); return(await GetResult <VineFollowersResponse>(request)); }
/// <summary> /// Gets a paged list of people the authenticated user is following /// </summary> /// <param name="options">paging options</param> /// <returns>Standard Paged Response of VineFollowers (similar to a VineProfile)</returns> public async Task <VineFollowersResponse> MyFollowing(VinePagingOptions options = null) { var request = GetBaseUserRequest(VineEndpoints.UserFollowers, Me, options); return(await GetResult <VineFollowersResponse>(request)); }