private void QueryCompleted(ITwitterQuery twitterQuery, string jsonResult, RateLimitTrackerMode rateLimitTrackerMode) { if (rateLimitTrackerMode != RateLimitTrackerMode.None) { _rateLimitUpdater.QueryExecuted(twitterQuery.QueryURL, _credentialsAccessor.CurrentThreadCredentials); } _tweetinviEvents.RaiseAfterQueryExecuted(new QueryAfterExecuteEventArgs(twitterQuery, jsonResult)); }
private void QueryCompleted(ITwitterQuery twitterQuery, IWebRequestResult webRequestResult, RateLimitTrackerMode rateLimitTrackerMode) { if (rateLimitTrackerMode != RateLimitTrackerMode.None) { var rateLimitHeaders = webRequestResult.Headers.Where(kvp => kvp.Key.StartsWith("x-rate-limit-")).ToDictionary(kvp => kvp.Key, kvp => kvp.Value); _rateLimitUpdater.QueryExecuted(twitterQuery.QueryURL, twitterQuery.TwitterCredentials, rateLimitHeaders); } _tweetinviEvents.RaiseAfterQueryExecuted(new QueryAfterExecuteEventArgs(twitterQuery, webRequestResult.Response, webRequestResult.Headers)); }
public string ExecuteQueryWithTemporaryCredentials(string queryURL, HttpMethod httpMethod, ITemporaryCredentials temporaryCredentials, IEnumerable <IOAuthQueryParameter> queryParameters) { CleanupQueryURL(ref queryURL); var twitterQuery = _twitterQueryFactory.Create(queryURL, httpMethod, temporaryCredentials); twitterQuery.QueryParameters = queryParameters; _tweetinviEvents.RaiseBeforeQueryExecute(new QueryBeforeExecuteEventArgs(twitterQuery)); var result = _twitterRequester.ExecuteQuery(twitterQuery); _tweetinviEvents.RaiseAfterQueryExecuted(new QueryAfterExecuteEventArgs(twitterQuery, result)); return(result); }