def login(): username = request.args.get('facebook_email', default=app.config['FACEBOOK_EMAIL']) password = request.args.get('facebook_password', default=app.config['FACEBOOK_PASSWORD']) fb_access_token = fb_auth_token.get_fb_access_token(username, password) fb_user_id = fb_auth_token.get_fb_id(fb_access_token) tinder_api.get_auth_token(fb_access_token, fb_user_id)
def tinderlogin(usrname, password): fb_access_token = fb.get_fb_access_token(usrname, password) fb_user_id = fb.get_fb_id(fb_access_token) token = ti.get_auth_token(fb_access_token, fb_user_id) if token: return False return True
def login_facebook(self, data): fb_access_token = fb_auth_token.get_fb_access_token( data["email"], data["password"]) fb_user_id = fb_auth_token.get_fb_id(fb_access_token) self.auth_token = tinder_api.get_auth_token(fb_access_token, fb_user_id) return tinder_api.get_self()
import time from tcollector.models import Human import tinder_api tinder_api.get_auth_token() LOCATIONS = [ { "lat": "48.8589507", "lon": "2.2770205", "label": "Paris (48.8589507, 2.2770205)", "visited": True, }, ] LIKE_SLEEP_TIME = 10 EXISTS = 0 CURRENT_LOCATION = "" loop = 0 while True: loop += 1 print(loop) if EXISTS <= 0: if all([location["visited"] for location in LOCATIONS]): print("un-visiting locations...") for location in LOCATIONS: location["visited"] = False for location in LOCATIONS: if not location["visited"]: print("Moving to {0}".format(location["label"]))
import sys import cv2 import matplotlib.pyplot as plt import numpy as np from skimage import io from tqdm import tqdm import features import tinder_api # Get tokens host = 'https://api.gotinder.com' # thanks to this line you do not need to import config.py or tinder_config_ex.py fb_access_token = tinder_api.config.fb_access_token fb_user_id = tinder_api.config.fb_user_id tinder_api.get_auth_token(fb_access_token, fb_user_id) # Create user directory user_dir = 'data/' + features.config.fb_username.split('@')[0] + '/' os.system('rm -rf ' + user_dir + ' && mkdir ' + user_dir) print('\nCreated User Directory: ' + user_dir) # Get your profile photos plotFlag = False print('\nYour profile photos:') myself = tinder_api.get_self() for index, p in enumerate(myself['photos']): print(p['url']) if plotFlag: img = io.imread(p['url'])[:, :, ::-1] plt.figure(figsize=(12, 12)) if index == 0 else None
def gettoken_id(fb_username, fb_password): fb_username = '******' fb_password = '******' global _id global fig host = 'https://api.gotinder.com' fb_access_token = fb_auth_token.get_fb_access_token( fb_username, fb_password) fb_user_id = fb_auth_token.get_fb_id(fb_access_token) tinder_api.get_auth_token(fb_access_token, fb_user_id, host) print("#################################################") while (like < 30 or dislike < 30): try: recommendations = tinder_api.get_recommendations() except: recommendations = tinder_api.get_recommendations() for index in range(len(recommendations['results'])): global images images = [] name = recommendations['results'][index]['name'] birth_date = features.calculate_age( recommendations['results'][index]['birth_date']) ping_time = recommendations['results'][index]['ping_time'] if name == '5 GUM': continue _id = recommendations['results'][index]['_id'] print("name is {} and is {} years old and bio is {}".format( name, birth_date, recommendations['results'][index]['bio'])) try: if recommendations['results'][index]['bio']: fig = plt.figure('Biography', figsize=(6, 4)) t = (recommendations['results'][index]['bio']) text = fig.text(0.5, 0.5, t, ha='center', va='center', size=10) text.set_path_effects([path_effects.Normal()]) plt.axis('off') plt.tight_layout() plt.show(block=False) except: plt.close() pass number_of_subplots = len(recommendations['results'][index]['photos']) if number_of_subplots < 1: continue elif number_of_subplots == 1: fig, axes = plt.subplots(figsize=(15, 15)) elif number_of_subplots <= 4: fig, axes = plt.subplots(1, number_of_subplots, figsize=(15, 15)) elif number_of_subplots > 4: fig, axes = plt.subplots(int(number_of_subplots / 4) + 1, 4, figsize=(15, 15)) fig.canvas.mpl_connect('key_press_event', press) subplots_adjust(hspace=0.000) for i, v in enumerate(range(number_of_subplots)): p = recommendations['results'][index]['photos'][i] image = io.imread(p['url']) images.append(image) if number_of_subplots == 1: axes.axis('off') axes.imshow(image) axes.axis('off') elif number_of_subplots <= 4: axes[i].axis('off') axes[i].imshow(image) axes[i].axis('off') else: axes[int(i / 4), int(i % 4)].axis('off') axes[int(i / 4), int(i % 4)].imshow(image) axes[int(i / 4), int(i % 4)].axis('off') if number_of_subplots == 5: for j in range(4): axes[int(i / 4), int(j)].axis('off') elif number_of_subplots > 5: while i % 4 != 0: axes[int(i / 4), int(i % 4)].axis('off') i += 1 plt.tight_layout() #plt.axis('off') plt.show(block=True) print("###################################")
def get_token(fb_token, fb_user_id): return api.get_auth_token(fb_token, fb_user_id)
import config import tinder_api fb_access_token = 'EAAiZCUc4Md9EBAFmv3xK6zYCzZCHSOyZC51fIhELQZBuEZBDUZCi9ggh2LWgR9ud1ekbzTafzZCyMcQQv2O5aOtFjXdi2ZBfPepUgZABQKzNDMC4wsjQLFZBWa0NWqoZBct1XqBa2N9TVbvGU9AgbVO44uCHNZCUvm1JjP1G3EIbjAbLdBBCS5ZB1tyrhRLH4KnU5I7kzQEZAU6T9MeQZDZD' fb_user_id = '100008093071585' a = tinder_api.get_auth_token(config.tinder_token) print(a) b = tinder_api.get_recommendations() print(b)