2

I am trying to get n followers where n could be 1,2,3,4 etc.. By default Linq To Twitter return all the followers. Is there any way I can define how many followers I need? My current code look like this

var followers = twitterCtx.Friendship
                   .Where(f => f.Type == FriendshipType.FollowersList
                       && f.UserID == twitterUserId.ToString())
                   .Select(f => new TwitterData()
                         {

                            Followers = f.Users.Where(t => t.Protected == false).Select(s => s).ToList()
                          ).FirstOrDefault();

Please suggest

Ammar Khan
  • 346
  • 1
  • 9
  • 27

1 Answers1

3
Followers = f.Users.Where(t => !t.Protected).Take(n).ToList()
Z .
  • 12,657
  • 1
  • 31
  • 56
  • Wow, that's really fast and up to the mark. Thank you very much Sir – Ammar Khan Feb 26 '14 at 20:23
  • I will mark your comment as an answer within 10 mins. Can you please help me a little bit more. I am getting this issue when I put my Twitter project inside Class Library and try to access with Win Form App. Any suggestion? – Ammar Khan Feb 26 '14 at 20:25
  • This issue: http://stackoverflow.com/questions/18370360/could-not-load-file-or-assembly-system-net-http-primitives-located-assemblys-m – Ammar Khan Feb 26 '14 at 20:26