Esempio n. 1
0
 def yield_users(self):
     """Returns a generator of nearby users as NormalUser()"""
     while True:
         resp = r.get('/user/recs')
         recs = resp['results'] if 'results' in resp else []
         for rec in recs:
             yield u.UserController(rec['_id']).get_user()
Esempio n. 2
0
 def yield_usersv2(self):
     """Returns a generator of nearby users as NormalUser() and calculates location"""
     while True:
         resp = r.get('/v2/recs/core?locale=en-US')
         recs = resp['data']['results'] if 'data' in resp else []
         for rec in recs:
             if rec['type'] == 'user':
                 yield u.UserController(rec['user']['_id']).get_user()
Esempio n. 3
0
 def yield_matches(self):
     """Returns a generator of matches as MatchUsers()"""
     resp = r.post('/updates', {"last_activity_date": ""})
     for match in reversed(resp['matches']):
         yield u.UserController(match['_id']).get_user()
Esempio n. 4
0
 def me(self):
     """Returns a UserModel() for the Session"""
     return u.UserController(r.get('/profile')['_id']).get_user()