Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

Commented Unassigned: How to use application authentication [2573]

$
0
0
Hi

I have set up my application with twitter and i used TweetInvi to connect to twitter. Everything works just fine, but the rate limit for Search is 180 while i expect it to be 450.

Below is how i authenticate
TwitterCredentials.SetCredentials(userAccessToken, userAccessSecret, consumerKey, consumerSecret);

var rateLimits = RateLimit.GetCurrentCredentialsRateLimits();

rateLimits.SearchTweetsLimit.Limit is giving 180.

I am using tweetinvi version 0.9.4.1.

Is this how i should use the authentication mechanism to activate application authentication? Can you please help me figure out why the user level rate limit is applied even though i am using an application level key.

BTW Fantastic API. Thanks so much for making it available for every one to use.

Thanks
S.
Comments: ** Comment from web user: linvi **

Just for the purpose of showing how to perform an Application only WebRequest at the current time.

``` C#
var mySearchQuery = "salut";
var credentials = CredentialsCreator.GenerateApplicationCredentials("xWMytIGSmXPuPe9OxwlQz1Wac", "n1l88uNwskBSu8hkuAumxieDRYKPKf7j4C13nbvAt0Z8ubu5iG");
var query = string.Format("https://api.twitter.com/1.1/search/tweets.json?q={0}", mySearchQuery);
var json = twitterRequestHandler.ExecuteQueryWithTemporaryCredentials(query, HttpMethod.GET, credentials, Enumerable.Empty<IOAuthQueryParameter>());
var searchResult = jsonConverter.DeserializeObject<ISearchResultsDTO>(json);
var tweets = Tweet.GenerateTweetsFromDTO(searchResult.TweetDTOs);
```

Obviously this is ugly but if you need it right now, this is the best I can give you.


Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>