2017-10-09 5 views
1

사용자가 내 계정을 찾았는지 아니면 그 문제와 관련하여 다른 계정을 발견했는지 탐지하려고합니다.LinqToTwitter 사용자가 나를 팔로우하는지 확인하십시오.

지금까지 :

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); 
          } 
         } 

내 계정이 다른 사람의 다음과 어디 찾을 수 있지만, 어떻게 반대 할 수 있습니까?

EDIT : 또 다른 유사한 질문이 있습니다.이 질문은 다른 사용자의 팔로어 목록을 가져 오는 것을 다루며, 많은 경우 목록을 검색하여 X 계정이 있는지 확인할 수 있기 때문에 충분합니다. 하지만 트위터에 액세스 할 수있는 횟수에는 제한이 있으며 한 번에 5000 명의 사용자 만 수익을 얻을 수 있기 때문에 단점이 있습니다 (누군가가 팔로어를 팔로우하는 사람이 백만 명이면 실용적이지 않습니다.)

그래서, 이 질문은 특별히 User.Following과 같은 부울이 있는지 묻고 있습니다. User.Following은 뒤를 돌아 가면 true를 반환합니다.

other question은 다른 사용자가 따르는 사람의 목록을 반환하는 것과 관련이있는 것처럼 보입니다.

+0

[Linq to Twitter를 사용하는 모든 팔로어 찾기?] (https://stackoverflow.com/questions/10724064/find-all-followers-for-a-user-using-linq-to- 지저귀다) – hellyale

답변

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); 
    } 
} 

주어진 사용자가 다른 특정 사용자를 따르는 지 여부는 true 또는 false입니다.