GetHomeTimeline not reliable

Dec 8, 2014 at 7:00 PM
var tweets = Timeline.GetHomeTimeline();
            if (tweets == null)
            {
                Debugmsg.Text = "read, but get nothing!";
                return -2;
            }
the above code, some times get results, some times get null.

I have no idea why, but it is not exception.

Please let me know how to get this thing solve.
Dec 9, 2014 at 5:48 PM
Hi,

This is an exception that is catched by the ExceptionHandler.
Please give more info concerning the issue and I will help you solve it.

Linvi
Dec 9, 2014 at 6:07 PM
Hi linvi,

while (AppOnOff == "ON")
{
if (connected == false)
{   
    TwitterCredentials.SetCredentials(TwitterClientToken, TwitterClientSecret, AppKey, AppSecret);
    return 0;
}
else
{
    try{
        var tweets = Timeline.GetHomeTimeline();
        if (tweets == null)
                {
            Debugmsg.Text = "read, but get nothing!";
                    return -2;
                }
                    else
                    {
                        // tweets parsing code
            return 1;
        }
    }
    catch(Exception e)
    {
        // handler, but get no any exception    
        return -1;
    }

}
}
Dec 9, 2014 at 6:22 PM
Tweetinvi does not throw any Exception by default. You will have to get the information from the ExceptionHandler (see documentation) or set it such as it does not swallow these.
ExceptionHandler.SwallowWebExceptions = false;
Linvi
Dec 9, 2014 at 6:53 PM
got this exception:
429, Too Many Requests - Returned in API v1.1 when a request cannot be served due to the application's rate limit having been exhausted for the resource. See Rate Limiting in API v1.1., Rate limit exceeded

but I send request 20 second after another. which is 45 requests for 15 minutes window. should be ok, right?
Dec 10, 2014 at 9:31 AM
If you want to track down the number of requests that are remaining you can use the RateLimit.
This will allow you to track down what is going wrong.

Linvi
Dec 10, 2014 at 5:42 PM
I thought the rate limit is 180, actually it is 15 for GetHomeTimeline. How come? the document said 180
Dec 10, 2014 at 7:03 PM
The rate limits are a nightmare, the documentation is very bad. Don't rely on the Twitter documentation.
Try, and Test is the only way to work with RateLimits. I am currently working on RateLimit tools for the 0.9.5.0 and it is a real pain.
Dec 10, 2014 at 7:08 PM
" Don't rely on the Twitter documentation. ", so funny
Dec 11, 2014 at 9:27 AM
This is sad but real. And it is not myself who says it, their developers gave me this answer when I asked them questions related to RateLimits.