forked from danzeeeman/tinder-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautoliker.py
42 lines (35 loc) · 1.01 KB
/
autoliker.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python
import os
import sys
import tinder
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']
tinder.get_like(_id)
print 'Liked ' + name + '!'
count += 1
except KeyboardInterrupt:
print_result(count)
exit(0)