Hi, I'm trying to use Tweetinvi to build a simple twitter app for WP. When I try to get the Home many tweets are dupliated. This is the code I'm using:
Alessandro
private async void GetTimeline()
{
IHomeTimelineRequestParameters parameters = new HomeTimelineRequestParameters();
parameters.ExcludeReplies = false;
if (sinceID != 0) parameters.SinceId = sinceID;
parameters.MaximumNumberOfTweetsToRetrieve = 200;
IEnumerable<ITweet> tweets = await TimelineAsync.GetHomeTimeline(parameters);
TwitterItem tweet = new TwitterItem();
foreach (var status in tweets)
{
Dispatcher.BeginInvoke(() =>
{
tweet.CreatedAt = status.CreatedAt;
tweet.ProfileImageSource = status.Creator.ProfileImageUrl.Replace("_normal","");
tweet.Text = Helper.RemoveTag(status.Text);
//tweet.UserName = status.Creator.Name + " " + status.Creator.ScreenName;
tweet.UserName = status.Creator.ScreenName;
tweet.Retweeted = status.Retweeted;
tweet.Id = status.Id;
HomeTimeline.Add(tweet);
});
}
TweetList.ItemsSource = HomeTimeline;
//sinceID = HomeTimeline.First().Id;
//Helper.AddSetting("sinceID", sinceID);
}
public class TwitterItem
{
public string UserName { get; set; }
public string Text { get; set; }
public string ProfileImageSource { get; set; }
public DateTime CreatedAt { get; set; }
public bool Retweeted { get; set; }
public long Id { get; set; }
}
Thank you,Alessandro