2

I'm developping an application that uses Twitter API to collect informations about users. I'm using linqToTwitter in my current project but it does not allow me a lot of thing that I want to do.

For example I need getting a follower list of a searched user. LinqToTwitter allowed me finding a user who the name is given and who is in the follower list of the authenticate user. The code is the following:

 public List<User> RecupererFollower()
        {
            var friendship =
                (from friend in MainPage.twitterCtxProp.Friendship
                where friend.Type == FriendshipType.FollowersList
                && friend.SourceScreenName==MainPage.texte
                select friend).ToList();


            Followers = (from friend in friendship
                         select new User                                      //Un utilisateur est créé grâce aux données récupérées précédemment.
                         {
                             Name = friend.ScreenName

                         }).ToList();                                         //Cette partie constitue la liste de tweets récupérés précédemment.

            return Followers;
        }

But even this doesn't work because this query requires a specific screenName of a particular user.

I don't want this I want more general functions.

What can I do? Someone knows other resources for Windows 8 metro application?

Kevser61
  • 95
  • 9
  • 1
    It's not clear what your question is - what data are you trying to get given what input? What do you mean by "more general functions"? Do realise that an API client library will probably only give you access to the API itself, you have to build your application's features over it yourself. – millimoose Feb 28 '13 at 14:13

1 Answers1

0

The @millimoose comment, "an API client library will probably only give you access to the API itself" is quite accurate. The particular query you're trying to use is documented at Handling Friendships. The documentation also refers to the original Twitter endpoint that it supports, which is Followers List in this case. On this particular API, the Twitter documentation states that either user_id or screen_name is required. The library can't support more than is available.

That said, you'll have to look at what's available and can sometimes accomplish your goal. i.e. There are also Social Graph queries that are very efficient because they return User IDs. With those User IDs, you can do a UserType.Lookup query to gather multiple users at a time. Here are a few links for UserType.Lookup queries:

Get all followers using LINQ to Twitter

How to get tweets from a multiple of friends?

Community
  • 1
  • 1
Joe Mayo
  • 7,501
  • 7
  • 41
  • 60
  • I used this function (lookup) it works. I got the follower Id list but now I have a problem with the request limits. Now I want to get follower names but when there are a lot of follower my function stop because of the limits. – Kevser61 Mar 05 '13 at 09:16
  • This looks like a similar or same question: http://stackoverflow.com/questions/15221534/cant-get-screenname-of-a-list-of-user-id-because-of-the-api-rate-limits-what-c/15226296#15226296 – Joe Mayo Mar 05 '13 at 14:24