GetHomeTimeLine not retrieving given number of tweets

Nov 23, 2014 at 5:11 AM
Hi, I'm trying to get a number of tweets from the user timeline, but no matter how I dot it it does not retrieve the given number. This is my code:
            var timelineParameter = Timeline.CreateHomeTimelineRequestParameter();
            timelineParameter.MaximumNumberOfTweetsToRetrieve = n;
            var timeLine = Timeline.GetHomeTimeline(timelineParameter);
            foreach (var tweet in timeLine)
            {
                Console.WriteLine(tweet.Text);
            }
n is a parameter given by the user. So if, for example, if I ask for 100 tweets the maximun I can get is 42. And when I ask for 1000 it only gives 113.

Is there a problem with my code?

Thank you.
Coordinator
Nov 25, 2014 at 6:07 PM
Hi,

There is no problem with your code. But are you sure that in both cases there are more than 42 or 113 tweets on the account?

Linvi
Nov 26, 2014 at 7:22 PM
linvi wrote:
Hi,

There is no problem with your code. But are you sure that in both cases there are more than 42 or 113 tweets on the account?

Linvi
Yes, in fact I'm checking all the app with my acccount and it does have more than those tweets and still I cannot retrieve the exact number.

For example, right now I'm experimenting with lower numbers, such as 10 and still sometimes I get 10, others 6 and others 7 or 8, but not the same number.

Is something wrong with the Twitter API or something? I can't find an explanation to this.

Thanks for the support!
Nov 27, 2014 at 9:56 AM
I have the same problem as (spaceisstrange) said, but little better :)
the function just retrieved top 200 tweets ( account has more then 1500 )
this is my code
TwitterCredentials.SetCredentials("28645XXXXXX-XXXXXXXXXXXXXXXXXXXX",
                    "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
                    "XXXXXXXXXXXXXXXXXXXX",
                    "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
            var loggedUser = Tweetinvi.User.GetLoggedUser();
            var areCredentialsValid = loggedUser != null;
            var homeTimelineTweets = loggedUser.GetHomeTimeline(250);
            i = 1;
            foreach (var tweet in homeTimelineTweets)
            {
                txtLog.AppendText(
                    String.Format("{0}. {1}{2}",i++,tweet.Text,Environment.NewLine)                    
                    );
            }
Coordinator
Dec 2, 2014 at 8:18 PM
This issue probably comes from the fact that the API is so unreliable.
Can you please let me know if the number of Tweets you receive is same for every call you make? Or does the number of retrieve tweet changes from one call to another?

Linvi
Dec 3, 2014 at 5:52 AM
For me it's 200 tweets every time I call the procedure
Dec 4, 2014 at 8:15 PM
whats about u (spaceisstrange) ?