Trouble searching on Twitter in asp.net Core By TweetSharp

79 Views Asked by At

I try to search with a word on Twitter but every time I run it comes back empty. I run two methods to execute. In the first method, I use the token given by Twitter, and in the second method, I take the token from online Twitter, but both methods return empty results.

TwitterService service= new TwitterService(_consumerKey, _consumerSecret);
twitterService.AuthenticateWith(_accessToken, _accessTokenSecret);
var options2 = new SearchOptions { Q = "VegaIt" };

            var tweets = service.Search(options2);

            foreach (var tweet in tweets.Statuses)
            {
                Console.WriteLine("{0} says '{1}'", tweet.User.ScreenName, tweet.Text);
            }

AND method

     TwitterService service = new TwitterService(_consumerKey, _consumerSecret);
    
                // Step 1 - Retrieve an OAuth Request Token
                OAuthRequestToken requestToken = service.GetRequestToken();
    
                // Step 2 - Redirect to the OAuth Authorization URL
                Uri uri = service.GetAuthorizationUri(requestToken);
    
                service.AuthenticateWith(requestToken.Token, requestToken.TokenSecret);

 var tweets = service.Search(options2);
    
                foreach (var tweet in tweets.Statuses)
                {
                    Console.WriteLine("{0} says '{1}'", tweet.User.ScreenName, tweet.Text);
                }

In both methods the answer "tweet" is Null

0

There are 0 best solutions below