Esempio n. 1
0
		public async Task<bool> ReplyAsync(ulong tweetId, string screenName, string content)
		{
			var tweetContent = CheckContent($"@{screenName} {content}");

			try
			{
				using (var context = new TwitterContext(_selfAuthorizer))
				{
					await context.ReplyAsync(tweetId, tweetContent);
					return true;
				}
			}
			catch (TwitterQueryException ex) when (ex.StatusCode == HttpStatusCode.Forbidden) // In case of duplicate
			{
				return false;
			}
		}
Esempio n. 2
0
        static async Task ReplyAsync(TwitterContext twitterCtx)
        {
            ulong tweetID = 401033367283453953;
            string status = "@JoeMayo Testing ReplyAsync #Linq2Twitter £ ";

                Status tweet = await twitterCtx.ReplyAsync(tweetID, status);

                if (tweet != null)
                    Console.WriteLine(
                        "Status returned: " +
                        "(" + tweet.StatusID + ")" +
                        tweet.User.Name + ", " +
                        tweet.Text + "\n");
        }
 public static void SendTweetReply( string twitterUser, string status, ulong replyId )
 {
     var twitterContext = new TwitterContext( TwitterHashtagMonitor.Authorizer );
     var tweet = string.Format( "@{0} {1}", twitterUser, status);
     Task.FromResult(twitterContext.ReplyAsync( replyId, tweet ) );
 }
 public static void SendMoreInfo( string twitterUser, Challenge challenge, ulong replyId )
 {
     var twitterContext = new TwitterContext( TwitterHashtagMonitor.Authorizer );
     var tweet = string.Format( "@{0} Congratulations! You earned {1} points, find out more about today's challenge at http://adventure-1.apphb.com/#/day/{2}/more", twitterUser, challenge.Value, challenge.ChallengeNumber );
     Task.FromResult( twitterContext.ReplyAsync( replyId, tweet ) );
 }