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 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 auth(self): """Checks for Authentication""" req = r.post('/v2/auth', {'token': c.tinder_token}) return req
def message(self, body): """Messages the user""" resp = r.post('/user/matches/{}'.format(self.match_id), {"message": str(body)}) return resp['sent_date']
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 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']