Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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);
        }