Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
 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()
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
 def post(self):
     parser = reqparse.RequestParser()
     parser.add_argument('id', type=str, help='id')
     parser.add_argument('password', type=str, help='password')
     args = parser.parse_args()
     fb_username = args['id']
     fb_password = args['password']
     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)
     result = {'fb_access_token': fb_access_token, 'fb_user_id': fb_user_id}
     return jsonify(result)
Ejemplo n.º 5
0
def get_fb_token():
  print("Getting Facebook token...")
  fb_token = fb_auth_token.get_fb_access_token(config.get_val('fb_email'), config.get_val('fb_password'))
  if not fb_token:
    print('Error getting Facebook token')
    return
  config.set_val('fb_token', fb_token)

  fb_id = fb_auth_token.get_fb_id(fb_token)
  if not fb_id:
    print('Error getting Facebook ID')
    return
  config.set_val('fb_id', fb_id)
Ejemplo n.º 6
0
import fb_auth_token

fb_username = "******"
fb_password = "******"
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)
host = "https://api.gotinder.com"

Ejemplo n.º 7
0
import fb_auth_token
import sys

email = sys.argv[1]
password = sys.argv[2]

token = fb_auth_token.get_fb_access_token(email, password)
fb_id = fb_auth_token.get_fb_id(token)

print token
print fb_id
Ejemplo n.º 8
0
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("###################################")