1

I am trying to detect if a user follows my account, or any other account in particular for that matter.

So far:

var user = await (from u in Session.service.User
                  where u.Type == UserType.Lookup && u.ScreenNameList == f.ScreenName
                  select u).ToListAsync();

                        if (user != null)
                        {
                            foreach (User u in user)
                            {
                                Cutil.Line("<Follow Check> - " + u.ScreenNameResponse + " is " + u.Following, ConsoleColor.Blue);
                            }
                        }

I can find out where my account follows someone else's, but how can I do the opposite?

EDIT: There is another similar question, which deals with getting a list of followers another users has - and in many cases this would be enough because you could just search that list and see if X account was on it. But, it has its disadvantages because there are limits on how many times you can access twitter and the method only yields 5000 users at a time (if someone has a million followers, this isn't very practical.)

So, this question is specifically asking if there is a bool like User.Following, that returns true if you are being followed back.

The other question seems concerned with returning a list of who the other user is following.

Colin Smith
  • 300
  • 2
  • 8
  • Possible duplicate of [Find all followers for a user using Linq to Twitter?](https://stackoverflow.com/questions/10724064/find-all-followers-for-a-user-using-linq-to-twitter) – M Y Oct 09 '17 at 16:10

1 Answers1

0
var friendships = await (from friendship in Session.service.Friendship
                         where friendship.Type == FriendshipType.Show && friendship.SourceScreenName == "twittername" && friendship.TargetScreenName == "othertwittername"
                         select friendship).ToListAsync();

if (friendships != null)
{
    foreach (Friendship friend in friendships)
    {
        Console.WriteLine(friend.SourceRelationship.FollowedBy);
    }
}

This will get whether or not a given user followers another given user, true or false.

Colin Smith
  • 300
  • 2
  • 8