-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
134 lines (115 loc) · 3.67 KB
/
index.js
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/**
* Tinder Auto Like
* Author: Paolo Carrara
*
* This is a simple js script for people that like me does not care for what I'm liking on Tinder,
* because if I dont't like the match I just go and unmatch it. That simple.
*
* If you are subscriber of one of Tinder's plans that gives you infinite likes you can just use this script
* to like everyone. They say you can like an 'unlimited' number of times, don't take that as granted as I already
* got 429 (Too Many Requests) code after some thousands.
*
* Anyway, go have fun and don't take Tinder very serious, it's full of retarde people, including me.
*/
var TinderAutoLike = (function () {
/**
* Time between two consecutive clicks.
* Don't set intervals smaller than 500 miliseconds, Tinder will block your requests.
*/
var intervalBetweenClicks = 1 * 1000; // 1 second
/**
* The game pad is the place where the main Tinder buttons are.
*/
var gamePad;
/**
* The beloved like button.
*/
var likeButton;
/**
* The superlike button.
* We are not using it here, be feel free to modify the code and use it.
*/
var superLikeButton;
/**
* The "no uglies for me today" button.
* We are not using it here, be feel free to modify the code and use it.
*/
var passButton;
/**
* The set interval id, needs to be saved in case you wanna stop.
*/
var setIntervalId;
/**
* A flag that tells if the process is running or not.
*/
var doesItStarted = false;
/**
* Gets all the interesting buttons and stuff.
*
* If you pay close attention you will notice that the buttons are got in 'best guess' manner, iee, we hope
* that the button at index 1 is the pass button, index 2 is the super like button and index 3 the like button,
* that means, if Tinder decides to changes its game pad disposition we'll need to adapt.
*/
function beforeStart () {
gamePad = document.getElementsByClassName('recsGamepad')[0];
passButton = gamePad.getElementsByTagName('button')[1]
superLikeButton = gamePad.getElementsByTagName('button')[2]
likeButton = gamePad.getElementsByTagName('button')[3]
}
/**
* It does what is says it does.
* If the process is running it restarts the process so the changes takes effect.
*/
function setIntervalBetweenClicks (newInterval) {
intervalBetweenClicks = newInterval;
if (doesItStarted) {
stop();
start();
}
}
/**
* It does what is says it does.
*/
function setStartedFlat (value) {
doesItStarted = value;
}
/**
* Starts the process.
*/
function start () {
beforeStart();
if (!doesItStarted) {
setStartedFlat(true);
setIntervalId = setInterval(function () {
likeButton.click();
}, intervalBetweenClicks);
}
}
/**
* Stops the process.
*/
function stop () {
if (doesItStarted) {
setStartedFlat(false);
clearInterval(setIntervalId);
}
}
/**
* Prints how to do the basic use of the script.
*/
function usage () {
console.log('Tinder Auto Like usage instructions:');
console.log('To start just run: TinderAutoLike.start();');
console.log('Yeah, that simple, it\'s gonna start the liking process until you run out of likes to give.');
}
usage();
/**
* TinderAutoLike interface.
*/
return {
setIntervalBetweenClicks: setIntervalBetweenClicks,
start: start,
stop: stop,
usage: usage
}
})();