コード例 #1
0
        // 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;
        }
コード例 #2
0
 /// <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));
 }
コード例 #3
0
 /// <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);
 }
コード例 #4
0
 /// <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);
 }
コード例 #5
0
 /// <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));
 }
コード例 #6
0
 /// <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));
 }
コード例 #7
0
 /// <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)));
 }
コード例 #8
0
        /// <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);
        }