Created
November 18, 2014 09:20
-
-
Save mcomisso/fdb565a2b65c9ea03c9a to your computer and use it in GitHub Desktop.
Tinder Auto like
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, json | |
#Commont utils url and authToken | |
authToken = "" | |
baseLikeUrl = "https://api.gotinder.com/like/" | |
baseProfileUrl = "https://api.gotinder.com/user/" | |
myFeed = "https://api.gotinder.com/user/recs" | |
s = requests.Session() | |
s.headers.update({'X-Auth-Token':authToken}) | |
s.headers.update({'User-Agent': 'Tinder/4.0.9 (iPhone; iOS 8.1.1; Scale/2.00)'}) | |
s.headers.update({'platform': 'ios'}) | |
s.headers.update({'Authorization': 'Token token="'+ authToken +'"'}) | |
myTinderFeed = s.get(myFeed) | |
#canBePrinted = r''.join(r.text).encode('utf-8') | |
#print canBePrinted | |
#Load the json response | |
json_feed = json.loads(myTinderFeed.text) | |
if json_feed.get('message'): | |
print json_feed['message'] | |
pass | |
else: | |
looper = len(json_feed['results']) | |
for x in xrange(0,looper): | |
newPersonName = u''.join(json_feed['results'][x]['name']).encode('utf-8') | |
_id = json_feed['results'][x]['_id'] | |
#profilePic = json_feed['results'][x]['photos'][0] | |
print newPersonName + " id: " + _id | |
personToLike = baseLikeUrl + _id | |
responseForLike = s.get(personToLike) | |
jsonResponseForLike = json.loads(responseForLike.text) | |
print "match? " + str(jsonResponseForLike['match']) | |
if jsonResponseForLike['match']: | |
matchedId = jsonResponseForLike['match']['_id'] | |
print "New match! id: " + matchedId | |
matchedPerson = s.get(baseProfileUrl + matchedId) | |
responsePerson = json.loads(matchedPerson.text) | |
name = u''.join(responsePerson["results"]["name"]).encode('utf-8') | |
#photo = responsePerson["results"]["photos"][0] | |
print name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment