Skip to content

Instantly share code, notes, and snippets.

@eduardosanzb
Last active May 6, 2019 21:20
Show Gist options
  • Save eduardosanzb/fff900ddb4ac27ed635c3b26bcf7a522 to your computer and use it in GitHub Desktop.
Save eduardosanzb/fff900ddb4ac27ed635c3b26bcf7a522 to your computer and use it in GitHub Desktop.
/**
* Small hack to automate tinder.com; With a friendly api
*/
function Tinder() {
const tinder = {};
tinder._waitTime = 8000
tinder.waitForIt = () => new Promise(resolve => (setTimeout(() => (resolve()), tinder._waitTime)));
tinder._run = true;
tinder.start = function(waitTime) {
if (waitTime) {
this._waitTime = waitTime
}
this._run = true;
this.body.next();
};
tinder.stop = function() {
this._run = false;
};
const body = async function*() {
while(true) {
if (!this._run) {
console.log(`Waiting for you to change run = true; Then call tinder.start()`)
yield;
}
await this.waitForIt();
$r.state.store.dispatch({ type: 'RECS_LIKE', payload: { method: 'BUTTON' } })
}
};
tinder.body = body.call(tinder)
tinder.start()
return tinder;
}
const tinder = Tinder();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment