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})
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
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
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)
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
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
def list_matches(self): """Returns a [] of matches""" return r.post('/updates', {"last_activity_date": ""})['matches']
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()
def message(self, body): """Messages the user""" resp = r.post('/user/matches/{}'.format(self.match_id), {"message": str(body)}) return resp['sent_date']
def dislike(self): """Dislikes (swipes left) the user""" resp = r.post('/pass/{}'.format(self.id)) return 'passed'
def super_like(self): """Super likes (swipes up) the user""" resp = r.post('/like/{}/super'.format(self.id), {}) return resp['match']
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
def recent(self): l = r.post('/profile', {"optimal": "recent"}) return l
def optimal(self): l = r.post('/profile', {"optimal": "blend"}) return l
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