Simple script to auto like the masses
I wrote this simple auto liker implementing the tinderjs api wrapper, wanted to share it with you guys :)
var FACEBOOK_ID = "facebook id obtained with charles method"
var FACEBOOK_TOKEN = "facebook token obtained with charles method"
var DISTANCE = '100'; //miles
var TinderPro = require('tinder_pro')
var tinder = new TinderPro()
var liked = 0;
var maxLikes = 1000;
var matches = 0;
tinder.sign_in(FACEBOOK_ID, FACEBOOK_TOKEN, function (err, res, body) {
tinder.update_search_distance(DISTANCE, function() {
recursivelyLike(tinder);
});
});
function recursivelyLike(tinder) {
tinder.get_nearby_users(function(err, res, body) {
var results = body.results;
results.forEach(function (result) {
tinder.like(result._id, function (err, res, body) {
liked++;
if (body.match) {
matches++;
}
console.log('Liked ' + result.name + ', it was ' + (body.match ? '' : 'not') + ' a match');
if(liked > maxLikes) {
console.log('=== FINISHED ===');
console.log('Liked: ' + liked + ', matched: ' + matches);
process.exit(0);
}
});
});
recursivelyLike(tinder);
});
}
That is really cool! Thanks @fabianCq !
It appears they changed their API?
Liked#1 Melanie, it was not a match
Liked#2 Tanya, it was not a match
Liked#3 Kaylin, it was not a match
Liked#4 Cheyenne, it was not a match
TypeError: Cannot read property 'match' of undefined
at /Users/Jaydeep/Developer/Tinder/liker.js:42:17
at Request._callback (/Users/Jaydeep/Developer/node_modules/tinder_pro/lib/requester.js:32:20)
at Request.self.callback (/Users/Jaydeep/Developer/node_modules/tinder_pro/node_modules/request/request.js:121:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request.<anonymous> (/Users/Jaydeep/Developer/node_modules/tinder_pro/node_modules/request/request.js:985:14)
at Request.EventEmitter.emit (events.js:117:20)
at IncomingMessage.<anonymous> (/Users/Jaydeep/Developer/node_modules/tinder_pro/node_modules/request/request.js:936:12)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)
@jaydeep, that doesn't look like a systematic error, like an API change you are thinking. Seems like the request didn't give you back a body... which could be many reasons. I would put more breakpoints and see what was returned on failed requests.
Dont work for me, Cannot call method 'forEach' of undefined....
@jaydeep i think they blocked your ip for too many request. Bear in mind they do have ddos protection so use with care
@davidX001 are you sure the charles method was succesfull? You need working tokens obtained through the app. You can spoof the auth call but i didnt bother since the tokens dont expire for 60 days after they've been last used
wrote a new script in 5 mins since the api got a little buggy in its responses.
var TinderPro = require('tinder_pro')
var tinder = new TinderPro();
var liked = 0;
var matches = 0;
tinder.sign_in(FACEBOOK_ID, FACEBOOK_TOKEN, function (err, res, body) {
tinder.update_search_distance(25, function() {
like_a_batch(tinder);
});
});
function like_a_batch (tinder) {
tinder.get_nearby_users(function (err, res, body) {
if (body && body.hasOwnProperty('results')) {
body.results.forEach(function (result) {
tinder.like(result._id, function (err, res, body) {
liked++;
if (body && body.hasOwnProperty('match')) {
console.log('Liked ' + pad(result.name, 20) + '(' + liked + '), it was ' + (body.match ? '' : 'not') + ' a match');
if (body.match) {
matches++;
}
}
});
});
}
like_a_batch(tinder);
});
}
function stopExecution() {
process.stdout.write("\n========================\n");
process.stdout.write("Liked " + liked + " people of whom " + matches + " where a match.");
process.exit();
}
process.on('SIGINT', function() {
stopExecution();
});
var STR_PAD_LEFT = 1;
var STR_PAD_RIGHT = 2;
var STR_PAD_BOTH = 3;
function pad(str, len, pad, dir) {
if (typeof(len) == "undefined") { var len = 0; }
if (typeof(pad) == "undefined") { var pad = ' '; }
if (typeof(dir) == "undefined") { var dir = STR_PAD_RIGHT; }
if (len + 1 >= str.length) {
switch (dir){
case STR_PAD_LEFT:
str = Array(len + 1 - str.length).join(pad) + str;
break;
case STR_PAD_BOTH:
var right = Math.ceil((padlen = len - str.length) / 2);
var left = padlen - right;
str = Array(left+1).join(pad) + str + Array(right+1).join(pad);
break;
default:
str = str + Array(len + 1 - str.length).join(pad);
break;
} // switch
}
return str;
}
Doesn't work...
./test.sh: line 1: syntax error near unexpected token (' ./test.sh: line 1: var TinderPro = require('tinder_pro')
@vegan22 that is not a shell script. It should be named with a .js extension and run with node, as in node test.js
@vegan22 @tranhungt this script still working?
Having trouble with require('tinder') oauth. not authorized