예제 #1
0
 public ExtractedTweet GetTweet(long statusId)
 {
     try
     {
         TweetinviConfig.CurrentThreadSettings.TweetMode = TweetMode.Extended;
         var tweet = Tweet.GetTweet(statusId);
         _statisticsHandler.CalledTweetApi();
         if (tweet == null)
         {
             return(null);               //TODO: test this
         }
         return(_tweetExtractor.Extract(tweet));
     }
     catch (Exception e)
     {
         _logger.LogError(e, "Error retrieving tweet {TweetId}", statusId);
         return(null);
     }
 }
예제 #2
0
        public ExtractedTweet GetTweet(long statusId)
        {
            try
            {
                _twitterAuthenticationInitializer.EnsureAuthenticationIsInitialized();
                ExceptionHandler.SwallowWebExceptions           = false;
                TweetinviConfig.CurrentThreadSettings.TweetMode = TweetMode.Extended;

                var tweet = Tweet.GetTweet(statusId);
                _statisticsHandler.CalledTweetApi();
                if (tweet == null)
                {
                    return(null);               //TODO: test this
                }
                return(_tweetExtractor.Extract(tweet));
            }
            catch (Exception e)
            {
                _logger.LogError(e, "Error retrieving tweet {TweetId}", statusId);
                return(null);
            }
        }