Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple script to auto like the masses #1

Open
FabianOudhaarlem opened this issue Aug 16, 2014 · 9 comments
Open

Simple script to auto like the masses #1

FabianOudhaarlem opened this issue Aug 16, 2014 · 9 comments

Comments

@FabianOudhaarlem
Copy link

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);            
    });
}
@tranhungt
Copy link
Owner

That is really cool!
Thanks @FabianCQ !

@jaydeep
Copy link

jaydeep commented Oct 7, 2014

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)

@tranhungt
Copy link
Owner

@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.

@anasbousselham
Copy link

Dont work for me,
Cannot call method 'forEach' of undefined....

@FabianOudhaarlem
Copy link
Author

@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

@FabianOudhaarlem
Copy link
Author

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;

}

@efraim-il
Copy link

Doesn't work...

./test.sh: line 1: syntax error near unexpected token (' ./test.sh: line 1: var TinderPro = require('tinder_pro')

@tranhungt
Copy link
Owner

@vegan22 that is not a shell script. It should be named with a .js extension and run with node, as in node test.js

@alexrmacleod
Copy link

alexrmacleod commented Sep 21, 2017

@vegan22 @tranhungt this script still working?

Having trouble with require('tinder') oauth. not authorized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants