def print_result(count): print 'You swiped right on ' + str(count) + ' people in this session!' facebook_token = sys.argv[1] if len(sys.argv) == 2 else os.environ['FACEBOOK_TOKEN'] fbToken = { 'facebook_token': facebook_token, 'facebook_id': os.environ['FACEBOOK_ID'] } tinder = tinder.tinderClient(fbToken) # Max out your distance to maximize how many people you can like. settings = {'distance_filter': 100} tinder.post_profile(settings) count = 0 # TODO: error handle when your auth token expires. while True: try: # Keep getting recs, over and over call = tinder.get_recs() # You've run out of potential matches if this branch is taken. if 'results' not in call: print_result(count) exit(0) recs = call['results'] for rec in recs: name = rec['name'] _id = rec['_id']
print 'You swiped right on ' + str(count) + ' people in this session!' facebook_token = sys.argv[1] if len( sys.argv) == 2 else os.environ['FACEBOOK_TOKEN'] fbToken = { 'facebook_token': facebook_token, 'facebook_id': os.environ['FACEBOOK_ID'] } tinder = tinder.tinderClient(fbToken) # Max out your distance to maximize how many people you can like. settings = {'distance_filter': 100} tinder.post_profile(settings) count = 0 # TODO: error handle when your auth token expires. while True: try: # Keep getting recs, over and over call = tinder.get_recs() # You've run out of potential matches if this branch is taken. if 'results' not in call: print_result(count) exit(0) recs = call['results'] for rec in recs: name = rec['name'] _id = rec['_id']
tinder = tinder.tinderClient(fbToken) print json.dumps(tinder.post_updates()) if args.action == 'recs': fbToken = args.token tinder = tinder.tinderClient(fbToken) print json.dumps(tinder.get_recs()) if args.action == 'profile': fbToken = args.token tinder = tinder.tinderClient(fbToken) if not args.data: print json.dumps(tinder.get_profile()) else: data = json.loads(args.data) print json.dumps(tinder.post_profile(data)) if args.action == 'ping': fbToken = args.token tinder = tinder.tinderClient(fbToken) print json.dumps(tinder.post_ping()) if args.action == 'location': fbToken = args.token tinder = tinder.tinderClient(fbToken) data = json.loads(args.data) print json.dumps(tinder.updateLocation(data['lat'], data['lon'])) if args.action == 'like': fbToken = args.token tinder = tinder.tinderClient(fbToken)