public bool WritePost(string text)
        {
            if (text.Length >= LimitCharsOnTweet)
            {
                var tweets = _messageSeparator.Separate(text, LimitCharsOnTweet).ToList();
                tweets.ForEach(x => _twitterClient.WriteTweet(x));
            }
            else
            {
                _twitterClient.WriteTweet(text);
            }

            return(true);
        }
Ejemplo n.º 2
0
 public void ReceiveMessage(string message)
 {
     if (string.IsNullOrEmpty(message))
     {
         throw new ArgumentNullException();
     }
     _twitterClient.WriteTweet(message);
     _twitterClient.SendTweetToServer(message);
 }
 public override void WritePost(string text)
 {
     try
     {
         _twitterClient.WriteTweet(text);
     }
     catch (Exception ex)
     {
         _logger.LogError(new EventId(ex.HResult), ex, ex.Message);
         throw new SocialNetClientException(ex.Message);
     }
 }