public List <Profile> GetNearbyUsers(string userId, string token) { int uId = Convert.ToInt32(userId); if (AuthService.ValidateAuthData(uId, token)) { InitializeOauth(token); try { //TODO add param List <int> nearbyUsersIds = foursquareOAuth.GetNearByUsers(1000); List <Profile> nearbyUsers = new List <Profile>(); foreach (var nearbyUsersId in nearbyUsersIds) { nearbyUsers.Add(foursquareOAuth.GetProfileInfo(nearbyUsersId)); } return(nearbyUsers); } catch (Exception e) { return(new List <Profile>()); } } return(null); }
public Profile GetMyProfile(string userId, string token) { int uId = Convert.ToInt32(userId); if (AuthService.ValidateAuthData(uId, token)) { FoursquareOAuth fsqOAuth = new FoursquareOAuth(token); Profile res = fsqOAuth.GetProfileInfo(uId); return(res); } return(null); }
public NameValueCollection GetProfileInfo(int targetId) { string token = GetCurrentUserToken(); Logic.FoursquareOAuth FSQOAuth = new FoursquareOAuth(token); Profile pf = FSQOAuth.GetProfileInfo(targetId); Models.FoursquareUserContext db = new FoursquareUserContext(); int userID = FSQOAuth.GetUserId(); FoursquareUserModel um = db.FoursquareUsers.Find(userID); NameValueCollection nv = pf.getInfo(um.IsPremium); nv["isPremium"] = um.IsPremium.ToString(); return(nv); }
public Profile GetProfile(string userId, string token, string targetId) { int uId = Convert.ToInt32(userId); int tId = Convert.ToInt32(targetId); if (AuthService.ValidateAuthData(uId, token)) { FoursquareUserContext dbContext = new FoursquareUserContext(); IMessageRepository repository = new MessageRepository(dbContext); FoursquareOAuth fsqOAuth = new FoursquareOAuth(token); if (fsqOAuth.CheckForFriendship(tId)) { Profile res = fsqOAuth.GetProfileInfo(tId); return(res); } } return(null); }