Esempio n. 1
0
 public TwitterFollowers Validate(TwitterFriends friends, TwitterFollowers followers)
 {
     var notFollowing = new TwitterFollowers {Ids = new List<long>()};
     foreach (var id in followers.Ids)
     {
         bool isFollowing = false;
         foreach (var friend in friends.Ids)
         {
             if (friend == id)
                 isFollowing = true;
         }
         if (! isFollowing) notFollowing.Ids.Add(id);
     }
     return notFollowing;
 }
Esempio n. 2
0
 public TwitterFollowers MapFollowers(string jsonResponse)
 {
     var jss = new JavaScriptSerializer();
     var data = jss.Deserialize<dynamic>(jsonResponse);
     if (data != null )
     {
         TwitterFollowers user = new TwitterFollowers();
         user.PreviousCursor =  data["next_cursor"];
         foreach (dynamic id in data["ids"])
         {
             if (user.Ids == null) user.Ids = new List<long>();
             user.Ids.Add(id);
         }
         return user;
     }
     return null;
 }