Exemplo n.º 1
0
 def get_updates(self, date=''):
     """Returns the profile 'updates' since date
     Date formatting is specific:
         date = '2017-03-25T20:58:00.404z"
         if date='' then returns updates since profile was made
     """
     return r.post('/updates', {"last_activity_date": date})
Exemplo n.º 2
0
 def report(self, cause, text=''):
     """Reports the user
     Cause:
         0 : 'other' requires text
         1 : 'spam'
         4 : 'inappropriate photos'
     """
     resp = r.post('/report/{}'.format(uid), {"cause": cause, "text": text})
     return resp
Exemplo n.º 3
0
 def auth(self):
     # currently not returing correctly, endpoint is missing?
     """Checks for Authentication"""
     req = r.post(
         '/auth/login/accountkit', {
             'token': c.tinder_token,
             'id': c.tinder_token,
             'client_version': '9.0.1'
         })
     return req
Exemplo n.º 4
0
 def update_profile(self, **kwargs):
     """Updates the session profile
     Kwargs - not all are known, type specific (int, str, dict, bool):
         age_filter_min=20
         age_filter_max=30
         bio='new bio who dis'
         distance_filter=100
         discoverable=true
         gender=1 <- seeking females
         {"photo_optimizer_enabled":false}
     """
     try:
         return r.post('/profile', kwargs)
     except Exception as e:
         print('Error in updating profile: ', e)
Exemplo n.º 5
0
 def reset_location(self):
     """Resets the session user's location to original location for Tinder+"""
     resp = r.post('/passport/user/reset', {})
     if 'error' in resp:
         return "Could not change location. Are you a tinder+ user?"
     return resp
Exemplo n.º 6
0
 def change_location(self, lat, lon):
     """Changes the session user's location for Tinder+"""
     resp = r.post('/passport/user/travel', {"lat": lat, "lon": lon})
     if 'error' in resp:
         return "Could not change location. Remeber +-=NS_lat and +-=EW_lon"
     return resp
Exemplo n.º 7
0
 def list_matches(self):
     """Returns a [] of matches"""
     return r.post('/updates', {"last_activity_date": ""})['matches']
Exemplo n.º 8
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()
Exemplo n.º 9
0
 def message(self, body):
     """Messages the user"""
     resp = r.post('/user/matches/{}'.format(self.match_id),
                   {"message": str(body)})
     return resp['sent_date']
Exemplo n.º 10
0
 def dislike(self):
     """Dislikes (swipes left) the user"""
     resp = r.post('/pass/{}'.format(self.id))
     return 'passed'
Exemplo n.º 11
0
 def super_like(self):
     """Super likes (swipes up) the user"""
     resp = r.post('/like/{}/super'.format(self.id), {})
     return resp['match']
Exemplo n.º 12
0
 def like_message(self):
     """Likes a message"""
     resp = r.post('/message/{}/like'.format(self.message_id), {})
     if 'error' in resp:
         return "Error, unable to like message"
     return resp
Exemplo n.º 13
0
 def recent(self):
     l = r.post('/profile', {"optimal": "recent"})
     return l
Exemplo n.º 14
0
 def optimal(self):
     l = r.post('/profile', {"optimal": "blend"})
     return l
Exemplo n.º 15
0
 def set_location(self, latlon) -> bool:
     resp = r.post('/passport/user/travel?locale=pt-BR', {
         "lat": latlon[0],
         "lon": latlon[1]
     })
     return True if resp["status"] == 200 else False