Exemplo n.º 1
0
        public int GetRemainingRequests()
        {
            _log.WriteIn();
            int rateLimitCount = 1;

            // WORKAROUND FOR LINUX (NullReferenceException on RateLimit.GetCredentialsRateLimits, WHY THE F**K IS IT HAPPENING)
            try
            {
                var rateLimit = RateLimit.GetCredentialsRateLimits(_user.Credentials);
                rateLimitCount = rateLimit.StatusesHomeTimelineLimit.Remaining;
                _log.Write($"Remaining requests: {rateLimitCount}");
            }
            catch (Exception e)
            {
                _log.Write(e);
            }

            return(rateLimitCount);
        }