コード例 #1
0
 /// <summary>
 /// Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
 /// </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 RetweetsOfMe(OAuthTokens tokens, RetweetsOfMeOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterStatusCollection>> function)
 {
     return AsyncUtility.ExecuteAsyncMethod(tokens, options, timeout, TwitterTimeline.RetweetsOfMe, function);
 }
コード例 #2
0
ファイル: Timelines.cs プロジェクト: jorgtowers/Twitterizer3
 /// <summary>
 /// Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="options">The options. Leave null for defaults.</param>
 /// <returns>A <see cref="TwitterStatusCollection"/> instance.</returns>
 public static async Task<TwitterResponse<TwitterStatusCollection>> RetweetsOfMeAsync(OAuthTokens tokens, RetweetsOfMeOptions options)
 {
     return await Core.CommandPerformer.PerformAction(new Commands.RetweetsOfMeCommand(tokens, options));
 }
コード例 #3
0
 /// <summary>
 /// Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="options">The options.</param>
 /// <returns>A <see cref="TwitterStatusCollection"/> instance.</returns>
 public static TwitterResponse<TwitterStatusCollection> RetweetsOfMe(OAuthTokens tokens, RetweetsOfMeOptions options)
 {
     return CommandPerformer.PerformAction(
         new Commands.RetweetsOfMeCommand(tokens, options));
 }
コード例 #4
0
        /// <summary>
        /// Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
        /// </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 RetweetsOfMe(OAuthTokens tokens, RetweetsOfMeOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterStatusCollection>> function)
        {
            Func<OAuthTokens, RetweetsOfMeOptions, TwitterResponse<TwitterStatusCollection>> methodToCall = TwitterTimeline.RetweetsOfMe;

            return methodToCall.BeginInvoke(
                tokens,
                options,
                result =>
                {
                    result.AsyncWaitHandle.WaitOne(timeout);
                    try
                    {
                        function(methodToCall.EndInvoke(result).ToAsyncResponse());
                    }
                    catch (Exception ex)
                    {
                        function(new TwitterAsyncResponse<TwitterStatusCollection>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
                    }
                },
                null);
        }
コード例 #5
0
 /// <summary>
 /// Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="options">The options.</param>
 /// <returns>A <see cref="TwitterStatusCollection"/> instance.</returns>
 public static TwitterResponse <TwitterStatusCollection> RetweetsOfMe(OAuthTokens tokens, RetweetsOfMeOptions options)
 {
     return(CommandPerformer.PerformAction(
                new Commands.RetweetsOfMeCommand(tokens, options)));
 }
コード例 #6
0
 /// <summary>
 /// Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
 /// </summary>
 /// <param name="tokens">The tokens.</param>
 /// <param name="options">The options. Leave null for defaults.</param>
 /// <returns>A <see cref="TwitterStatusCollection"/> instance.</returns>
 public static async Task <TwitterResponse <TwitterStatusCollection> > RetweetsOfMeAsync(OAuthTokens tokens, RetweetsOfMeOptions options)
 {
     return(await Core.CommandPerformer.PerformAction(new Commands.RetweetsOfMeCommand(tokens, options)));
 }
コード例 #7
0
 public string[] GetRetweet()
 {
     RetweetsOfMeOptions options = new RetweetsOfMeOptions {SinceStatusId = lastRetweetId};
     TwitterResponse<TwitterStatusCollection> response = TwitterTimeline.RetweetsOfMe(oAuthTokens, options);
     string[] values = new string[] { };
     if (response.Result == RequestResult.Success)
     {
         TwitterStatusCollection statuses = response.ResponseObject;
         List<TwitterStatus> listStatuses = new List<TwitterStatus>(statuses);
         this.lastRetweetId = listStatuses.Min(t => t.Id);
         TwitterStatus status = listStatuses.Find(t => t.Id == this.lastRetweetId);
         values = new string[] { status.CreatedDate.ToShortDateString(), status.User.Name, status.Text };
     }
     return values;
 }
コード例 #8
0
 /// <summary>
 /// Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
 /// </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 RetweetsOfMe(OAuthTokens tokens, RetweetsOfMeOptions options, TimeSpan timeout, Action <TwitterAsyncResponse <TwitterStatusCollection> > function)
 {
     return(AsyncUtility.ExecuteAsyncMethod(tokens, options, timeout, TwitterTimeline.RetweetsOfMe, function));
 }