Search code examples
c#linq-to-twitter

Get Twitter Home Time Line for a User by using his ScreenName


Is there any way, I can get the Home Time line for a user by passing his screenName? I currently have a code to get the timeline for authenticated user. But I also want to get for other users by using the same authenticated account. Is it possible? OR I need to introduce some other kind of authentication for this to work?

 public async void GetHomeTimeLine(string screenName)
            {
                _screenName = screenName;
                var twitterContext = new TwitterContext(_auth);
                var tweets = await twitterContext.Status
                    .Where(s => s.ScreenName == _screenName 
&& s.Type == StatusType.Home && s.Count == 200)
                    .ToListAsync();


            }

Solution

  • The Twitter API doesn't offer an option to provide a screen name on Home timeline. You either need to authorize as the user who owns the timeline or do a Friends/FollowerList query to get IDs and then query the tweets of the friends based on their user id.