// Get all user that a specific user follows public string GetResponse(RepositoryOptions options) { var opt = new UsersIdsOptions(); opt.UserId = Decimal.Parse(options.twitterUser.id_str); if (options.nextCursor == null) opt.Cursor = 0; else { if (options.nextCursor == "") opt.Cursor = 0; else opt.Cursor = long.Parse(options.nextCursor); } var response = TwitterFriendship.FriendsIds(GenerateAuthentication(),opt); return response.Content; }
/// <summary> /// Returns the numeric IDs for every user the specified user is following. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="options">The options.</param> /// <returns> /// A <see cref="TwitterListCollection"/> instance. /// </returns> public static TwitterResponse <UserIdCollection> FollowersIds(OAuthTokens tokens, UsersIdsOptions options) { Commands.FollowersIdsCommand command = new Commands.FollowersIdsCommand(tokens, options); return(Core.CommandPerformer.PerformAction(command)); }
/// <summary> /// Returns the numeric IDs for every user the specified user is following. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="options">The options.</param> /// <returns> /// A <see cref="TwitterListCollection"/> instance. /// </returns> public static TwitterResponse<UserIdCollection> FollowersIds(OAuthTokens tokens, UsersIdsOptions options) { Commands.FollowersIdsCommand command = new Commands.FollowersIdsCommand(tokens, options); return Core.CommandPerformer.PerformAction(command); }
/// <summary> /// Returns the numeric IDs for every user the specified user is friends with. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="options">The options.</param> /// <param name="timeout">The timeout.</param> /// <param name="function">The function.</param> /// <returns></returns> public static IAsyncResult FriendsIds(OAuthTokens tokens, UsersIdsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<UserIdCollection>> function) { return AsyncUtility.ExecuteAsyncMethod(tokens, options, timeout, TwitterFriendship.FriendsIds, function); }
/// <summary> /// Returns the numeric IDs for every user the specified user is friends with. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="options">The options. Leave null for defaults.</param> /// <returns> /// A <see cref="TwitterListCollection"/> instance. /// </returns> public static async Task<TwitterResponse<UserIdCollection>> FriendsIdsAsync(OAuthTokens tokens, UsersIdsOptions options = null) { return await Core.CommandPerformer.PerformAction(new Commands.FriendsIdsCommand(tokens, options)); }
/// <summary> /// Returns the numeric IDs for every user the specified user is friends with. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="options">The options.</param> /// <param name="timeout">The timeout.</param> /// <param name="function">The function.</param> /// <returns></returns> public static IAsyncResult FriendsIds(OAuthTokens tokens, UsersIdsOptions options, TimeSpan timeout, Action <TwitterAsyncResponse <UserIdCollection> > function) { return(AsyncUtility.ExecuteAsyncMethod(tokens, options, timeout, TwitterFriendship.FriendsIds, function)); }
/// <summary> /// Returns the numeric IDs for every user the specified user is friends with. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="options">The options. Leave null for defaults.</param> /// <returns> /// A <see cref="TwitterListCollection"/> instance. /// </returns> public static async Task <TwitterResponse <UserIdCollection> > FriendsIdsAsync(OAuthTokens tokens, UsersIdsOptions options = null) { return(await Core.CommandPerformer.PerformAction(new Commands.FriendsIdsCommand(tokens, options))); }
/// <summary> /// Returns the numeric IDs for every user the specified user is following. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="options">The options.</param> /// <param name="timeout">The timeout.</param> /// <param name="function">The function.</param> /// <returns></returns> public static IAsyncResult FollowersIds(OAuthTokens tokens, UsersIdsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<UserIdCollection>> function) { Func<OAuthTokens, UsersIdsOptions, TwitterResponse<UserIdCollection>> methodToCall = TwitterFriendship.FollowersIds; return methodToCall.BeginInvoke( tokens, options, result => { result.AsyncWaitHandle.WaitOne(timeout); try { function(methodToCall.EndInvoke(result).ToAsyncResponse()); } catch (Exception ex) { function(new TwitterAsyncResponse<UserIdCollection>() { Result = RequestResult.Unknown, ExceptionThrown = ex }); } }, null); }