/// <summary>
        /// Initializes the command.
        /// </summary>
        public override void Init()
        {
            // Default values
            this.RequestParameters.Add("cursor", "-1");

            // Handle optional parameters
            FollowersOptions options = this.OptionalProperties as FollowersOptions;

            if (options == null)
            {
                return;
            }

            if (options.UserId > 0)
            {
                this.RequestParameters.Add("user_id", options.UserId.ToString("#"));
            }

            if (!string.IsNullOrEmpty(options.ScreenName))
            {
                this.RequestParameters.Add("screen_name", options.ScreenName);
            }

            // Override the default
            if (options.Cursor != 0)
            {
                this.RequestParameters["cursor"] = options.Cursor.ToString(CultureInfo.CurrentCulture);
            }
        }
        public static void ReradusTest()
        {
            //OAuthTokens tokens = Configuration.GetTokens();

            FollowersOptions options = new FollowersOptions();

            //options.ScreenName = _Screenname;
            options.UserId = 189996115;
            var followers = TwitterFriendship.Followers(options);
        }
Exemple #3
0
        public void ReradusTest()
        {
            //OAuthTokens tokens = Configuration.GetTokens();

            FollowersOptions options = new FollowersOptions();

            //options.ScreenName = _Screenname;
            options.UserId = 189996115;
            var followers = TwitterFriendship.Followers(options);

            Assert.IsNotNull(followers.ResponseObject, followers.ErrorMessage);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="FollowersCommand"/> class.
        /// </summary>
        /// <param name="tokens">The request tokens.</param>
        /// <param name="options">The options.</param>
        public FollowersCommand(OAuthTokens tokens, FollowersOptions options)
            : base(HTTPVerb.GET, "statuses/followers.json", tokens, options)
        {
            if (tokens == null && options == null)
            {
                throw new ArgumentException("You must provide an authorization token or specify a user.");
            }

            if (tokens == null && options != null && options.UserId <= 0 && string.IsNullOrEmpty(options.ScreenName))
            {
                throw new ArgumentException("Either a user id or screen name (but not both) must be supplied (using the options parameter) when called unauthorized.");
            }

            this.DeserializationHandler = TwitterUserCollection.DeserializeWrapper;
        }