static void GetPlayers()
        {
            if (m_gameTweetID == 0)
            {
                RetweetsOptions retweets = new RetweetsOptions();
                retweets.Id    = idnum;
                retweets.Count = 100;
                var result = service.Retweets(retweets, (Retweets, response) =>
                {
                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                    {
                        Console.ForegroundColor = ConsoleColor.Green;
                        Console.WriteLine($"<{DateTime.Now}> - List Gotten!");

                        foreach (TwitterStatus status in (List <TwitterStatus>)Retweets)
                        {
                            WebClient wc = new WebClient();

                            Stream data         = wc.OpenRead("http://ggj.fsh.zone/sethandle/?handle=@" + status.User.ScreenName);
                            StreamReader reader = new StreamReader(data);
                            string s            = reader.ReadToEnd();
                            data.Close();
                            reader.Close();

                            if (!m_retweetList.Contains(status))
                            {
                                m_retweetList.Add(status);
                            }
                        }

                        foreach (TwitterStatus l in m_retweetList)
                        {
                            Console.WriteLine(l.User.Id);
                        }

                        Console.WriteLine(m_retweetList.Count);

                        Console.ResetColor();
                    }
                    else
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine($"<{DateTime.Now}> - List Not Gotten!");
                        Console.WriteLine(response.StatusCode + " " + response.StatusDescription + " " + response.Error);
                        Console.ResetColor();
                    }
                });
            }
        }
示例#2
0
        /// <summary>
        /// Initializes the command.
        /// </summary>
        public override void Init()
        {
            this.RequestParameters.Add("id", this.StatusId.ToString("#"));

            RetweetsOptions options = this.OptionalProperties as RetweetsOptions;

            if (options == null)
            {
                return;
            }

            if (options.Count > 0)
            {
                this.RequestParameters.Add("count", options.Count.ToString(CultureInfo.InvariantCulture));
            }
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RetweetsCommand"/> class.
        /// </summary>
        /// <param name="tokens">The request tokens.</param>
        /// <param name="statusId">The status id.</param>
        /// <param name="options">The options.</param>
        public RetweetsCommand(OAuthTokens tokens, decimal statusId, RetweetsOptions options)
            : base(
                HTTPVerb.GET,
                string.Format(CultureInfo.InvariantCulture, "statuses/retweets/{0}.json", statusId),
                tokens,
                options)
        {
            if (tokens == null)
            {
                throw new ArgumentNullException("tokens");
            }

            if (statusId <= 0)
            {
                throw new ArgumentNullException("statusId");
            }

            this.StatusId = statusId;
        }