Following and Follows Your

Oct 15, 2012 at 2:20 AM

When returned info tells is if we're following a user that has posted a status to our timeline like so,

Following = tweets[i].User.Following,

How do we know in that same query if this user is following the sign in user?

As in,

FollowsMe = tweets[i].User.FollowsMe (bool)?


Oct 16, 2012 at 12:12 PM


What query are you using? Something in the Friendships API?


Oct 16, 2012 at 11:18 PM
Edited Oct 16, 2012 at 11:22 PM

I need to know if the user that posted to the logged in users home timeline is a friend, and was hoping that was provided in the following request.


It lets me know if the currently logged user is following, but is it possible to know if the owner of the status posted to a timeline is a friend?


I’ve noticed that owners timelines do have statuses posted to their home timeline that they are not following.


 if (sinceID > 0)
                queryResponse =
                   (from tweet in twitterCtx.Status
                    where tweet.Type == StatusType.Home
                    && tweet.SinceID == sinceID
                    select tweet);
                queryResponse =
                   (from tweet in twitterCtx.Status
                    where tweet.Type == StatusType.Home
                    select tweet);

            var tweets = queryResponse.ToList();
            ulong statusID = 0;
            TwitterHomeResponse thr;
            List<TwitterHomeResponse> lthr = new List<TwitterHomeResponse>(tweets.Count);

            for (int i = 0; i < tweets.Count; i++)
                thr = new TwitterHomeResponse();
                thr.Text = tweets[i].Text;
                thr.CreatedAt = tweets[i].CreatedAt.ToString("MM/dd/yy HH:mm:ss");
                if (tweets[i].StatusID != null)
                    ulong.TryParse(tweets[i].StatusID, out statusID);
                    thr.StatusID = statusID;
                thr.Retweeted = tweets[i].Retweeted;
                thr.RetweetCnt = tweets[i].RetweetCount;
                thr.Favorited = tweets[i].Favorited;
                thr.User = new TwitterUser
                    ID = tweets[i].User.Identifier.UserID,
                    Name = tweets[i].User.Name,
                    ScreenName = tweets[i].User.Identifier.ScreenName,
                    Url = tweets[i].User.Url,
                    Descr = tweets[i].User.Description,
                    Loc = tweets[i].User.Location,
                    ProfileImgUrl = tweets[i].User.ProfileImageUrlHttps,
                    Tweets = tweets[i].User.StatusesCount,
                    Followers = tweets[i].User.FollowersCount,
                    Friends = tweets[i].User.FriendsCount,
                    Following = tweets[i].User.Following
            resmsg = Request.CreateResponse(HttpStatusCode.Accepted, new { home = lthr });
            return resmsg;





From: JoeMayo [email removed]
Sent: Tuesday, October 16, 2012 7:13 AM
Subject: Re: Following and Follows Your [LinqToTwitter:399327]


From: JoeMayo

Oct 17, 2012 at 12:14 AM

I understand what you need now. I can't find anything like that on the User entity, which I double-checked with Twitter docs. I'm thinking there are a couple ways to do this, depending on what you think is best for your application: SocialGraph or Friendship APIs. With the friendship API, you would make a single call to find out if they are friends.  With the social graph, you can query ids for all of a user's friends, cache the list, and do a cache lookup for each tweet.